diff options
author | Roger Sayle <roger@eyesopen.com> | 2004-10-30 00:56:59 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2004-10-30 00:56:59 +0000 |
commit | 5976e643ed10a021367870663b1105aaf064393a (patch) | |
tree | 3e72bc5f754672ecac841d4642054de785714fa0 /gcc/cselib.c | |
parent | 8b5a12daa03d076b8b57dc565333eecb8d1880d0 (diff) | |
download | gcc-5976e643ed10a021367870663b1105aaf064393a.tar.gz |
re PR rtl-optimization/17581 (Long long arithmetic fails inside a switch/case statement when compiled with -O2)
PR rtl-optimization/17581
* cselib.c (cselib_process_insn): The last instruction of a libcall
block, with the REG_RETVAL note, should be considered in the libcall.
* gcse.c (do_local_cprop): Allow constants to be propagated outside
of libcall blocks.
(adjust_libcall_notes): Use simplify_replace_rtx instead of
replace_rtx to avoid creating invalid RTL in REG_RETVAL notes.
* gcc.dg/pr17581-1.c: New test case.
From-SVN: r89873
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r-- | gcc/cselib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c index e58f2541d4d..eb0b52a2edc 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -1346,8 +1346,6 @@ cselib_process_insn (rtx insn) if (find_reg_note (insn, REG_LIBCALL, NULL)) cselib_current_insn_in_libcall = true; - if (find_reg_note (insn, REG_RETVAL, NULL)) - cselib_current_insn_in_libcall = false; cselib_current_insn = insn; /* Forget everything at a CODE_LABEL, a volatile asm, or a setjmp. */ @@ -1358,12 +1356,16 @@ cselib_process_insn (rtx insn) && GET_CODE (PATTERN (insn)) == ASM_OPERANDS && MEM_VOLATILE_P (PATTERN (insn)))) { + if (find_reg_note (insn, REG_RETVAL, NULL)) + cselib_current_insn_in_libcall = false; clear_table (); return; } if (! INSN_P (insn)) { + if (find_reg_note (insn, REG_RETVAL, NULL)) + cselib_current_insn_in_libcall = false; cselib_current_insn = 0; return; } @@ -1399,6 +1401,8 @@ cselib_process_insn (rtx insn) if (GET_CODE (XEXP (x, 0)) == CLOBBER) cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0)); + if (find_reg_note (insn, REG_RETVAL, NULL)) + cselib_current_insn_in_libcall = false; cselib_current_insn = 0; if (n_useless_values > MAX_USELESS_VALUES) |