aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-11-29 00:01:03 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-11-29 00:01:03 +0100
commitf5d30aa62f848a163193ac95e4e0f26aa8383d92 (patch)
tree7b496948f97b7aefb30aa0a4e58d895e46a65c3c /gcc/cselib.c
parent5d99894e654b30324d5ab24069159ff9bc853c6a (diff)
downloadgcc-f5d30aa62f848a163193ac95e4e0f26aa8383d92.zip
gcc-f5d30aa62f848a163193ac95e4e0f26aa8383d92.tar.gz
gcc-f5d30aa62f848a163193ac95e4e0f26aa8383d92.tar.bz2
re PR debug/36728 ([stack]: gdb doesn't work with stack alignment)
PR debug/36728 PR debug/55467 PR middle-end/55507 PR bootstrap/55511 * cselib.c (cselib_process_insn): If cselib_preserve_constants, don't reset table and exit early on volatile insns and setjmp. Reset table afterwards on setjmp. * gcc.dg/guality/pr36728-1.c: Include "../nop.h", make sure the asm are non-empty and add dependency between the first and second asm. * gcc.dg/guality/pr36728-2.c: Likewise. * gcc.dg/guality/pr36728-3.c: New test. * gcc.dg/guality/pr36728-4.c: New test. From-SVN: r193911
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 198be8a..a2f60ec 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -2626,11 +2626,12 @@ cselib_process_insn (rtx insn)
cselib_current_insn = insn;
/* Forget everything at a CODE_LABEL, a volatile insn, or a setjmp. */
- if (LABEL_P (insn)
- || (CALL_P (insn)
- && find_reg_note (insn, REG_SETJMP, NULL))
- || (NONJUMP_INSN_P (insn)
- && volatile_insn_p (PATTERN (insn))))
+ if ((LABEL_P (insn)
+ || (CALL_P (insn)
+ && find_reg_note (insn, REG_SETJMP, NULL))
+ || (NONJUMP_INSN_P (insn)
+ && volatile_insn_p (PATTERN (insn))))
+ && !cselib_preserve_constants)
{
cselib_reset_table (next_uid);
cselib_current_insn = NULL_RTX;
@@ -2668,9 +2669,18 @@ cselib_process_insn (rtx insn)
/* Look for any CLOBBERs in CALL_INSN_FUNCTION_USAGE, but only
after we have processed the insn. */
if (CALL_P (insn))
- for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1))
- if (GET_CODE (XEXP (x, 0)) == CLOBBER)
- cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0));
+ {
+ for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1))
+ if (GET_CODE (XEXP (x, 0)) == CLOBBER)
+ cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0));
+ /* Flush evertything on setjmp. */
+ if (cselib_preserve_constants
+ && find_reg_note (insn, REG_SETJMP, NULL))
+ {
+ cselib_preserve_only_values ();
+ cselib_reset_table (next_uid);
+ }
+ }
/* On setter of the hard frame pointer if frame_pointer_needed,
invalidate stack_pointer_rtx, so that sp and {,h}fp based