aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.com>2016-03-18 19:09:08 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2016-03-18 19:09:08 +0000
commit5c6a601cd2eac3730d4e00a0c1fe0b3cdb5fc1b4 (patch)
tree56844518935399d010918f8fc3def7ad42f8012f /gcc/lra-constraints.c
parent4bbf545b8b47ef2a1a2a8a666f88dfe7ba9fe23a (diff)
downloadgcc-5c6a601cd2eac3730d4e00a0c1fe0b3cdb5fc1b4.zip
gcc-5c6a601cd2eac3730d4e00a0c1fe0b3cdb5fc1b4.tar.gz
gcc-5c6a601cd2eac3730d4e00a0c1fe0b3cdb5fc1b4.tar.bz2
Fix PR70278, a problem with the previous split_reg change
PR rtl-optimization/70278 * lra-constraints.c (split_reg): Handle the case where biggest_mode is VOIDmode. testsuite/ * gcc.dg/torture/pr70278.c: New test. * gcc.target/arm/pr70278.c: New test. From-SVN: r234342
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index ced9e12..4883eef 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -4982,7 +4982,12 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
nregs = 1;
mode = lra_reg_info[hard_regno].biggest_mode;
machine_mode reg_rtx_mode = GET_MODE (regno_reg_rtx[hard_regno]);
- if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (reg_rtx_mode))
+ /* A reg can have a biggest_mode of VOIDmode if it was only ever seen
+ as part of a multi-word register. In that case, or if the biggest
+ mode was larger than a register, just use the reg_rtx. Otherwise,
+ limit the size to that of the biggest access in the function. */
+ if (mode == VOIDmode
+ || GET_MODE_SIZE (mode) > GET_MODE_SIZE (reg_rtx_mode))
{
original_reg = regno_reg_rtx[hard_regno];
mode = reg_rtx_mode;