summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-11 19:53:11 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-11 19:53:11 +0000
commit750a330e3c5ea0ee3a0ba6991939d9387d100727 (patch)
treeb8e43a1106916133f6889b90922be4c1b0c3b737 /gcc/local-alloc.c
parent647e9f063f0f3df989bf6b81e5416009fa73822a (diff)
downloadgcc-750a330e3c5ea0ee3a0ba6991939d9387d100727.tar.gz
* fwprop.c (try_fwprop_subst): Use set_unique_reg_note
to add the REG_EQ* note. * see.c (see_merge_one_use_extension): Likewise. * local-alloc.c (update_equiv_regs): Likewise. Also don't turn REG_EQUAL notes into REG_EQUIV notes if the target register may have more than one set. * function.c (assign_parm_setup_reg): Use set_unique_reg_note. * gcse.c (try_replace_reg): Likewise. * alias.c (init_alias_analysis): Use find_reg_equal_equiv_note. * calls.c (fixup_tail_calls): Likewise. Abort if there is more than one REG_EQUIV note. * reload1.c (gen_reload): Use set_unique_reg_note. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121821 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index e6ff69e48a5..6f24968f10c 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -930,8 +930,13 @@ update_equiv_regs (void)
/* If this register is known to be equal to a constant, record that
it is always equivalent to the constant. */
- if (note && ! rtx_varies_p (XEXP (note, 0), 0))
- PUT_MODE (note, (enum machine_mode) REG_EQUIV);
+ if (REG_N_SETS (regno) == 1
+ && note && ! rtx_varies_p (XEXP (note, 0), 0))
+ {
+ rtx note_value = XEXP (note, 0);
+ remove_note (insn, note);
+ set_unique_reg_note (insn, REG_EQUIV, note_value);
+ }
/* If this insn introduces a "constant" register, decrease the priority
of that register. Record this insn if the register is only used once
@@ -953,9 +958,7 @@ 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,
- copy_rtx (SET_SRC (set)),
- REG_NOTES (insn));
+ note = set_unique_reg_note (insn, REG_EQUIV, copy_rtx (SET_SRC (set)));
if (note)
{
@@ -1061,9 +1064,8 @@ update_equiv_regs (void)
if (validate_equiv_mem (init_insn, src, dest)
&& ! memref_used_between_p (dest, init_insn, insn))
{
- REG_NOTES (init_insn)
- = gen_rtx_EXPR_LIST (REG_EQUIV, copy_rtx (dest),
- REG_NOTES (init_insn));
+ set_unique_reg_note (init_insn, REG_EQUIV, copy_rtx (dest));
+
/* This insn makes the equivalence, not the one initializing
the register. */
reg_equiv_init[regno]