aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-11-13 14:25:30 +1030
committerAlan Modra <amodra@gcc.gnu.org>2018-11-13 14:25:30 +1030
commit7877f4e000e999a902cf2898a535ae8e8ad45a3f (patch)
tree076d41a9e8b41926eb635d993ddc07e421d49d22 /gcc/config
parentc6459f2dfa63a6581233eb143b7614422c88b352 (diff)
downloadgcc-7877f4e000e999a902cf2898a535ae8e8ad45a3f.zip
gcc-7877f4e000e999a902cf2898a535ae8e8ad45a3f.tar.gz
gcc-7877f4e000e999a902cf2898a535ae8e8ad45a3f.tar.bz2
[RS6000] secondary_reload and find_replacement
This patch removes a call only necessary when using reload. It also corrects a PRE_DEC address offset. * config/rs6000/rs6000.c (rs6000_secondary_reload_inner): Negate offset for PRE_DEC. (rs6000_secondary_reload_gpr): Don't call find_replacement. From-SVN: r266049
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/rs6000.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e0b1bbb..516e697 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -19701,7 +19701,10 @@ rs6000_secondary_reload_inner (rtx reg, rtx mem, rtx scratch, bool store_p)
if ((addr_mask & RELOAD_REG_PRE_INCDEC) == 0)
{
- emit_insn (gen_add2_insn (op_reg, GEN_INT (GET_MODE_SIZE (mode))));
+ int delta = GET_MODE_SIZE (mode);
+ if (GET_CODE (addr) == PRE_DEC)
+ delta = -delta;
+ emit_insn (gen_add2_insn (op_reg, GEN_INT (delta)));
new_addr = op_reg;
}
break;
@@ -19901,17 +19904,6 @@ rs6000_secondary_reload_gpr (rtx reg, rtx mem, rtx scratch, bool store_p)
&& GET_CODE (XEXP (addr, 1)) == PLUS
&& XEXP (XEXP (addr, 1), 0) == XEXP (addr, 0));
scratch_or_premodify = XEXP (addr, 0);
- if (!HARD_REGISTER_P (scratch_or_premodify))
- /* If we have a pseudo here then reload will have arranged
- to have it replaced, but only in the original insn.
- Use the replacement here too. */
- scratch_or_premodify = find_replacement (&XEXP (addr, 0));
-
- /* RTL emitted by rs6000_secondary_reload_gpr uses RTL
- expressions from the original insn, without unsharing them.
- Any RTL that points into the original insn will of course
- have register replacements applied. That is why we don't
- need to look for replacements under the PLUS. */
addr = XEXP (addr, 1);
}
gcc_assert (GET_CODE (addr) == PLUS || GET_CODE (addr) == LO_SUM);