aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2006-11-10 22:42:04 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2006-11-10 21:42:04 +0000
commit3e916873cb9c0e4a7865a06be6f0d4a714c7617e (patch)
tree7b0c4d5780c7da1e20a8d73c2051cd1de97dda2e /gcc
parentd8d8121add34439d69187182bacea680468270df (diff)
downloadgcc-3e916873cb9c0e4a7865a06be6f0d4a714c7617e.zip
gcc-3e916873cb9c0e4a7865a06be6f0d4a714c7617e.tar.gz
gcc-3e916873cb9c0e4a7865a06be6f0d4a714c7617e.tar.bz2
cse.c (cse_process_notes): Copy the propagated value.
* cse.c (cse_process_notes): Copy the propagated value. * local-alloc.c (update_equiv_regs): Copy the memory RTX to be used in REG_EQUIV notes. * gcse.c (try_replace_reg): Copy the replacement. * i386.c (emit_i387_cw_initialization): Copy stored_mode (assign_386_stack_local): Always return copied memory expression * function.c (instantiate_virtual_regs_in_insn): Copy the operand duplicates. From-SVN: r118665
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/cse.c2
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/gcse.c5
-rw-r--r--gcc/local-alloc.c7
6 files changed, 24 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ce55f03..da4b39e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2006-11-10 Jan Hubicka <jh@suse.cz>
+ * cse.c (cse_process_notes): Copy the propagated value.
+ * local-alloc.c (update_equiv_regs): Copy the memory RTX to be used
+ in REG_EQUIV notes.
+ * gcse.c (try_replace_reg): Copy the replacement.
+ * i386.c (emit_i387_cw_initialization): Copy stored_mode
+ (assign_386_stack_local): Always return copied memory expression
+ * function.c (instantiate_virtual_regs_in_insn): Copy the operand
+ duplicates.
+
+2006-11-10 Jan Hubicka <jh@suse.cz>
+
* final.c (final): Walk from first instruction.
* cfglayout.c (insn_locators_initialize): Remove line number notes.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 89f88ed..c797ff7 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -8589,7 +8589,7 @@ emit_i387_cw_initialization (int mode)
rtx reg = gen_reg_rtx (HImode);
emit_insn (gen_x86_fnstcw_1 (stored_mode));
- emit_move_insn (reg, stored_mode);
+ emit_move_insn (reg, copy_rtx (stored_mode));
if (TARGET_64BIT || TARGET_PARTIAL_REG_STALL || optimize_size)
{
@@ -13520,7 +13520,7 @@ assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
for (s = ix86_stack_locals; s; s = s->next)
if (s->mode == mode && s->n == n)
- return s->rtl;
+ return copy_rtx (s->rtl);
s = (struct stack_local_entry *)
ggc_alloc (sizeof (struct stack_local_entry));
diff --git a/gcc/cse.c b/gcc/cse.c
index 1988377..8bd2758 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5817,7 +5817,7 @@ cse_process_notes (rtx x, rtx object)
{
rtx new = gen_lowpart (GET_MODE (x), ent->const_rtx);
if (new)
- return new;
+ return copy_rtx (new);
}
}
diff --git a/gcc/function.c b/gcc/function.c
index 12e391a..cef7fe3 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1540,7 +1540,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
/* Propagate operand changes into the duplicates. */
for (i = 0; i < recog_data.n_dups; ++i)
*recog_data.dup_loc[i]
- = recog_data.operand[(unsigned)recog_data.dup_num[i]];
+ = copy_rtx (recog_data.operand[(unsigned)recog_data.dup_num[i]]);
/* Force re-recognition of the instruction for validation. */
INSN_CODE (insn) = -1;
diff --git a/gcc/gcse.c b/gcc/gcse.c
index f121495..0518e4c 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -2647,6 +2647,11 @@ try_replace_reg (rtx from, rtx to, rtx insn)
int success = 0;
rtx set = single_set (insn);
+ /* Usually we substitute easy stuff, so we won't copy everything.
+ We however need to take care to not duplicate non-trivial CONST
+ expressions. */
+ to = copy_rtx (to);
+
validate_replace_src_group (from, to, insn);
if (num_changes_pending () && apply_change_group ())
success = 1;
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index c103400..e6ff69e 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -907,7 +907,7 @@ update_equiv_regs (void)
REG_EQUAL note on the insn. Since this note would be redundant,
there's no point creating it earlier than here. */
if (! note && ! rtx_varies_p (src, 0))
- note = set_unique_reg_note (insn, REG_EQUAL, src);
+ note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
/* Don't bother considering a REG_EQUAL note containing an EXPR_LIST
since it represents a function call */
@@ -953,7 +953,8 @@ update_equiv_regs (void)
if (note == 0 && REG_BASIC_BLOCK (regno) >= 0
&& MEM_P (SET_SRC (set))
&& validate_equiv_mem (insn, dest, SET_SRC (set)))
- REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV, SET_SRC (set),
+ REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV,
+ copy_rtx (SET_SRC (set)),
REG_NOTES (insn));
if (note)
@@ -1061,7 +1062,7 @@ update_equiv_regs (void)
&& ! memref_used_between_p (dest, init_insn, insn))
{
REG_NOTES (init_insn)
- = gen_rtx_EXPR_LIST (REG_EQUIV, dest,
+ = gen_rtx_EXPR_LIST (REG_EQUIV, copy_rtx (dest),
REG_NOTES (init_insn));
/* This insn makes the equivalence, not the one initializing
the register. */