aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-05-17 07:00:02 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-05-17 07:00:02 +0000
commit23b33725083ba1a1c3340b81475f2940d8f2e436 (patch)
treed0bbc16685eb58141c00c2372960b318c757d524 /gcc/function.c
parente16db39967ab6aaef964cae249087d37c18984a0 (diff)
downloadgcc-23b33725083ba1a1c3340b81475f2940d8f2e436.zip
gcc-23b33725083ba1a1c3340b81475f2940d8f2e436.tar.gz
gcc-23b33725083ba1a1c3340b81475f2940d8f2e436.tar.bz2
emit-rtl.h (replace_equiv_address, [...]): Add an inplace argument.
gcc/ * emit-rtl.h (replace_equiv_address, replace_equiv_address_nv): Add an inplace argument. Store the new address in the original MEM when true. * emit-rtl.c (change_address_1): Likewise. (adjust_address_1, adjust_automodify_address_1, offset_address): Update accordingly. * rtl.h (plus_constant): Add an inplace argument. * explow.c (plus_constant): Likewise. Try to reuse the original PLUS when true. Avoid generating (plus X (const_int 0)). * function.c (instantiate_virtual_regs_in_rtx): Adjust the PLUS in-place. Pass true to plus_constant. (instantiate_virtual_regs_in_insn): Pass true to replace_equiv_address. From-SVN: r210543
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 9be76a9..d269c54 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1459,8 +1459,8 @@ instantiate_virtual_regs_in_rtx (rtx *loc, void *data)
new_rtx = instantiate_new_reg (XEXP (x, 0), &offset);
if (new_rtx)
{
- new_rtx = plus_constant (GET_MODE (x), new_rtx, offset);
- *loc = simplify_gen_binary (PLUS, GET_MODE (x), new_rtx, XEXP (x, 1));
+ XEXP (x, 0) = new_rtx;
+ *loc = plus_constant (GET_MODE (x), x, offset, true);
if (changed)
*changed = true;
return -1;
@@ -1622,7 +1622,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
continue;
start_sequence ();
- x = replace_equiv_address (x, addr);
+ x = replace_equiv_address (x, addr, true);
/* It may happen that the address with the virtual reg
was valid (e.g. based on the virtual stack reg, which might
be acceptable to the predicates with all offsets), whereas
@@ -1635,7 +1635,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
if (!safe_insn_predicate (insn_code, i, x))
{
addr = force_reg (GET_MODE (addr), addr);
- x = replace_equiv_address (x, addr);
+ x = replace_equiv_address (x, addr, true);
}
seq = get_insns ();
end_sequence ();