summaryrefslogtreecommitdiff
path: root/gcc/regcprop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-10-13 09:23:54 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-10-13 09:23:54 +0000
commit610c45fcbfff43176beefefcea74c6137a432220 (patch)
treefc56c08135f71cfb00cb65322910c3e569682d8e /gcc/regcprop.c
parent5752d1f7943db65667edeaf8481dc10b60a23197 (diff)
Make more use of subreg_lowpart_offset
This patch uses subreg_lowpart_offset in places that open-coded the calculation. It also uses it in regcprop.c to test whether, after a mode change, the first register in a multi-register group is still the right one. 2017-10-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * calls.c (expand_call): Use subreg_lowpart_offset. * cse.c (cse_insn): Likewise. * regcprop.c (copy_value): Likewise. (copyprop_hardreg_forward_1): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r253713
Diffstat (limited to 'gcc/regcprop.c')
-rw-r--r--gcc/regcprop.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 73e945d45ae..5db5b5d9fdf 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -345,8 +345,7 @@ copy_value (rtx dest, rtx src, struct value_data *vd)
We can't properly represent the latter case in our tables, so don't
record anything then. */
else if (sn < hard_regno_nregs (sr, vd->e[sr].mode)
- && (GET_MODE_SIZE (vd->e[sr].mode) > UNITS_PER_WORD
- ? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN))
+ && subreg_lowpart_offset (GET_MODE (dest), vd->e[sr].mode) != 0)
return;
/* If SRC had been assigned a mode narrower than the copy, we can't
@@ -871,8 +870,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
/* And likewise, if we are narrowing on big endian the transformation
is also invalid. */
if (REG_NREGS (src) < hard_regno_nregs (regno, vd->e[regno].mode)
- && (GET_MODE_SIZE (vd->e[regno].mode) > UNITS_PER_WORD
- ? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN))
+ && subreg_lowpart_offset (mode, vd->e[regno].mode) != 0)
goto no_move_special_case;
}