aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2014-01-23 20:06:28 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2014-01-23 20:06:28 +0000
commit6e23f2967868d307d367385411a5e61e6de2c02b (patch)
tree3c4587bb80623ea093acd96ddf83fb8e6f30c554 /gcc/lra-constraints.c
parentf04dda3093541436d9ebd3194761ff8199c5ac79 (diff)
downloadgcc-6e23f2967868d307d367385411a5e61e6de2c02b.zip
gcc-6e23f2967868d307d367385411a5e61e6de2c02b.tar.gz
gcc-6e23f2967868d307d367385411a5e61e6de2c02b.tar.bz2
re PR rtl-optimization/59915 (LRA ICE - Repeated looping over subreg reloads (gcc.c-torture/compile/simd-3.c))
2014-01-23 Vladimir Makarov <vmakarov@redhat.com> PR regression/59915 * lra-constraints.c (simplify_operand_subreg): Spill pseudo if there is a danger of looping. From-SVN: r207007
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 7454229..34159f7 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1291,9 +1291,20 @@ simplify_operand_subreg (int nop, enum machine_mode reg_mode)
&& ! LRA_SUBREG_P (operand))
|| CONSTANT_P (reg) || GET_CODE (reg) == PLUS || MEM_P (reg))
{
- /* The class will be defined later in curr_insn_transform. */
- enum reg_class rclass
- = (enum reg_class) targetm.preferred_reload_class (reg, ALL_REGS);
+ enum reg_class rclass;
+
+ if (REG_P (reg)
+ && curr_insn_set != NULL_RTX
+ && (REG_P (SET_SRC (curr_insn_set))
+ || GET_CODE (SET_SRC (curr_insn_set)) == SUBREG))
+ /* There is big probability that we will get the same class
+ for the new pseudo and we will get the same insn which
+ means infinite looping. So spill the new pseudo. */
+ rclass = NO_REGS;
+ else
+ /* The class will be defined later in curr_insn_transform. */
+ rclass
+ = (enum reg_class) targetm.preferred_reload_class (reg, ALL_REGS);
if (get_reload_reg (curr_static_id->operand[nop].type, reg_mode, reg,
rclass, "subreg reg", &new_reg))