re PR debug/65678 (internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:909)
authorVladimir Makarov <vmakarov@redhat.com>
Tue, 7 Apr 2015 15:01:07 +0000 (15:01 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Tue, 7 Apr 2015 15:01:07 +0000 (15:01 +0000)
2015-04-07  Vladimir Makarov  <vmakarov@redhat.com>

PR target/65678
* lra-remat.c (do_remat): Process input and non-input insn
registers separately.

From-SVN: r221901

gcc/ChangeLog
gcc/lra-remat.c

index d4bf73ad9a7d6cb2726ab792d699e7fd48e16a12..9e9c7a94df67fa6533d4d1ed836df02b4165f6cc 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-07  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR target/65678
+       * lra-remat.c (do_remat): Process input and non-input insn
+       registers separately.
+
 2015-04-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/65678
index 36ea79282deb462892edbcf8f2e67f75ed8858d0..a23cb5ba3e7771da300b903f9dc0432bb8df4f7f 100644 (file)
@@ -1234,22 +1234,25 @@ do_remat (void)
                for (i = 0; i < nregs; i++)
                  CLEAR_HARD_REG_BIT (live_hard_regs, hard_regno + i);
              }
-           else if (reg->type != OP_IN
-                    && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
+         /* Process also hard regs (e.g. CC register) which are part
+            of insn definition.  */
+         for (reg = static_id->hard_regs; reg != NULL; reg = reg->next)
+           if (reg->type == OP_IN
+               && find_regno_note (insn, REG_DEAD, reg->regno) != NULL)
+             CLEAR_HARD_REG_BIT (live_hard_regs, reg->regno);
+         /* Inputs have been processed, now process outputs.  */
+         for (reg = id->regs; reg != NULL; reg = reg->next)
+           if (reg->type != OP_IN
+               && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
              {
                if ((hard_regno = get_hard_regs (reg, nregs)) < 0)
                  continue;
                for (i = 0; i < nregs; i++)
                  SET_HARD_REG_BIT (live_hard_regs, hard_regno + i);
              }
-         /* Process also hard regs (e.g. CC register) which are part
-            of insn definition.  */
          for (reg = static_id->hard_regs; reg != NULL; reg = reg->next)
-           if (reg->type == OP_IN
-               && find_regno_note (insn, REG_DEAD, reg->regno) != NULL)
-             CLEAR_HARD_REG_BIT (live_hard_regs, reg->regno);
-           else if (reg->type != OP_IN
-                    && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
+           if (reg->type != OP_IN
+               && find_regno_note (insn, REG_UNUSED, reg->regno) == NULL)
              SET_HARD_REG_BIT (live_hard_regs, reg->regno);
        }
     }