re PR rtl-optimization/65123 (lra remat places insn which breaks data flow)
authorVladimir Makarov <vmakarov@redhat.com>
Tue, 24 Feb 2015 18:11:38 +0000 (18:11 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Tue, 24 Feb 2015 18:11:38 +0000 (18:11 +0000)
2015-02-24  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/65123
* lra-remat.c (operand_to_remat): Check hard regs in insn
definition too.

From-SVN: r220946

gcc/ChangeLog
gcc/lra-remat.c

index 8bd6151b89d8a12ca003a582403fb62f809dcca6..6941bce0ab4a704060465006913f70f19d53f5a1 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-24  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/65123
+       * lra-remat.c (operand_to_remat): Check hard regs in insn
+       definition too.
+
 2015-02-24  Nick Clifton  <nickc@redhat.com>
 
        * config/v850/v850.h (ASM_SPEC): Pass -msoft-float/-mhard-float on
index de5081a739abf2a57a00038b0ab334918d773b7c..fb0eb3c1f7b7cd0ee268c75082a7bd4a41586cca 100644 (file)
@@ -459,6 +459,16 @@ operand_to_remat (rtx_insn *insn)
             reg2 = reg2->next)
          if (reg2->type == OP_OUT && reg->regno == reg2->regno)
            return -1;
+       if (reg->regno < FIRST_PSEUDO_REGISTER)
+         for (struct lra_insn_reg *reg2 = static_id->hard_regs;
+              reg2 != NULL;
+              reg2 = reg2->next)
+           if (reg2->type == OP_OUT
+               && reg->regno <= reg2->regno
+               && (reg2->regno
+                   < (reg->regno
+                      + hard_regno_nregs[reg->regno][reg->biggest_mode])))
+             return -1;
       }
   /* Find the rematerialization operand.  */
   int nop = static_id->n_operands;