summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-09 00:26:34 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-09 00:26:34 +0000
commit5c345371282b0ced3cffc94edf9a281887119c34 (patch)
tree424ab1377c7f1bbb66c3532a2d7d64391c87ef02
parent230f09435a0964b0435bd27cb9824fdfdae21f64 (diff)
downloadgcc-5c345371282b0ced3cffc94edf9a281887119c34.tar.gz
* flow.c (init_propagate_block_info): Protect the rtx stored in
mem_set_list from modification by find_auto_inc. (mark_set_1): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37330 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/flow.c26
2 files changed, 30 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ef955ac66f8..e28acbc3d89 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2000-11-08 Richard Henderson <rth@redhat.com>
+
+ * flow.c (init_propagate_block_info): Protect the rtx stored in
+ mem_set_list from modification by find_auto_inc.
+ (mark_set_1): Likewise.
+
2000-11-08 Neil Booth <neilb@earthling.net>
Move directive handling into the lexer itself.
diff --git a/gcc/flow.c b/gcc/flow.c
index d286f91e2b3..b855114d47b 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -3930,7 +3930,21 @@ init_propagate_block_info (bb, live, local_set, flags)
|| (GET_CODE (XEXP (mem, 0)) == PLUS
&& XEXP (XEXP (mem, 0), 0) == frame_pointer_rtx
&& GET_CODE (XEXP (XEXP (mem, 0), 1)) == CONST_INT))
- pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
+ {
+#ifdef AUTO_INC_DEC
+ /* Store a copy of mem, otherwise the address may be scrogged
+ by find_auto_inc. This matters because insn_dead_p uses
+ an rtx_equal_p check to determine if two addresses are
+ the same. This works before find_auto_inc, but fails
+ after find_auto_inc, causing discrepencies between the
+ set of live registers calculated during the
+ calculate_global_regs_live phase and what actually exists
+ after flow completes, leading to aborts. */
+ if (flags & PROP_AUTOINC)
+ mem = shallow_copy_rtx (mem);
+#endif
+ pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
+ }
}
}
@@ -4561,7 +4575,15 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
everything that invalidates it. To be safe, don't eliminate any
stores though SP; none of them should be redundant anyway. */
&& ! reg_mentioned_p (stack_pointer_rtx, reg))
- pbi->mem_set_list = alloc_EXPR_LIST (0, reg, pbi->mem_set_list);
+ {
+#ifdef AUTO_INC_DEC
+ /* Store a copy of mem, otherwise the address may be
+ scrogged by find_auto_inc. */
+ if (flags & PROP_AUTOINC)
+ reg = shallow_copy_rtx (reg);
+#endif
+ pbi->mem_set_list = alloc_EXPR_LIST (0, reg, pbi->mem_set_list);
+ }
}
if (GET_CODE (reg) == REG