]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/60650 ([ARM] LRA ICE in assign_by_spills)
authorVladimir Makarov <vmakarov@redhat.com>
Wed, 2 Apr 2014 20:55:02 +0000 (20:55 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Wed, 2 Apr 2014 20:55:02 +0000 (20:55 +0000)
2014-04-02  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/60650
* lra-constraints.c (process_alt_operands): Decrease reject for
earlyclobber matching.

2014-04-02  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/60650
* gcc.target/arm/pr60650-2.c: New.

From-SVN: r209038

gcc/ChangeLog
gcc/lra-constraints.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr60650-2.c [new file with mode: 0644]

index 11293cc800e6fcc104544f2aa8675ef03130a052..1b2f824ff5d773295e25ab5a91c13e5bf17b74ec 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-02  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/60650
+       * lra-constraints.c (process_alt_operands): Decrease reject for
+       earlyclobber matching.
+
 2014-04-02  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * config/s390/s390.c (s390_expand_insv): Use GET_MODE_BITSIZE.
 2014-03-27  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/60650
-       * lra-asign.c (find_hard_regno_for, spill_for): Add parameter
+       * lra-assign.c (find_hard_regno_for, spill_for): Add parameter
        first_p.  Use it.
        (find_spills_for): New.
        (assign_by_spills): Pass the new parameter to find_hard_regno_for.
index cfc3d7eaaee26d6cb1c7fe2839f1af17863ad78f..aac50876d21a5c9be55803d9022892861984bf47 100644 (file)
@@ -1747,12 +1747,27 @@ process_alt_operands (int only_alternative)
                                  [GET_MODE (*curr_id->operand_loc[m])]);
                          }
 
-                       /* We prefer no matching alternatives because
-                          it gives more freedom in RA.  */
-                       if (operand_reg[nop] == NULL_RTX
-                           || (find_regno_note (curr_insn, REG_DEAD,
-                                                REGNO (operand_reg[nop]))
-                                == NULL_RTX))
+                       /* Prefer matching earlyclobber alternative as
+                          it results in less hard regs required for
+                          the insn than a non-matching earlyclobber
+                          alternative.  */
+                       if (curr_static_id->operand[m].early_clobber)
+                         {
+                           if (lra_dump_file != NULL)
+                             fprintf
+                               (lra_dump_file,
+                                "            %d Matching earlyclobber alt:"
+                                " reject--\n",
+                                nop);
+                           reject--;
+                         }
+                       /* Otherwise we prefer no matching
+                          alternatives because it gives more freedom
+                          in RA.  */
+                       else if (operand_reg[nop] == NULL_RTX
+                                || (find_regno_note (curr_insn, REG_DEAD,
+                                                     REGNO (operand_reg[nop]))
+                                    == NULL_RTX))
                          {
                            if (lra_dump_file != NULL)
                              fprintf
@@ -2143,7 +2158,7 @@ process_alt_operands (int only_alternative)
                }
              /* If the operand is dying, has a matching constraint,
                 and satisfies constraints of the matched operand
-                which failed to satisfy the own constraints, probably
+                which failed to satisfy the own constraints, most probably
                 the reload for this operand will be gone.  */
              if (this_alternative_matches >= 0
                  && !curr_alt_win[this_alternative_matches]
index 19e2cd644759f18e4e74ad8645fe7295d3bcd53c..2decdf152ba95ca6507fc435186c9e210a7c7521 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-02  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/60650
+       * gcc.target/arm/pr60650-2.c: New.
+
 2014-04-02  Joseph Myers  <joseph@codesourcery.cmo>
 
        * gcc.target/i386/avx2-vpand-3.c,
diff --git a/gcc/testsuite/gcc.target/arm/pr60650-2.c b/gcc/testsuite/gcc.target/arm/pr60650-2.c
new file mode 100644 (file)
index 0000000..1946760
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-omit-frame-pointer -march=armv7-a" } */
+
+int a, h, j;
+long long d, e, i;
+int f;
+fn1 (void *p1, int p2)
+{
+    switch (p2)
+    case 8:
+{
+    register b = *(long long *) p1, c asm ("r2");
+    asm ("%0": "=r" (a), "=r" (c):"r" (b), "r" (0));
+    *(long long *) p1 = c;
+    }
+}
+
+fn2 ()
+{
+    int k;
+    k = f;
+    while (1)
+    {
+        fn1 (&i, sizeof i);
+        e = d + k;
+        switch (d)
+        case 0:
+        (
+        {
+            register l asm ("r4");
+            register m asm ("r0");
+            asm ("  .err  .endif\n\t": "=r" (h), "=r" (j):"r" (m),
+            "r"
+            (l));;
+        });
+    }
+}