re PR rtl-optimization/60851 (ICE: in extract_constrain_insn_cached, at recog.c:2117...
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 20 Mar 2015 06:07:30 +0000 (07:07 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 20 Mar 2015 06:07:30 +0000 (07:07 +0100)
PR rtl-optimization/60851
* recog.c (constrain_operands): Accept a pseudo register before reload
for LRA enabled targets.

testsuite/ChangeLog:

PR rtl-optimization/60851
* gcc.target/i386/pr60851.c: New test.

From-SVN: r221529

gcc/ChangeLog
gcc/recog.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr60851.c [new file with mode: 0644]

index 2b9f9d0e24a2d6e07df164597b81f43c1c55abe8..30d6a5e74a25c0c5701d712f63aa8e75a1abc850 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-20  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/60851
+       * recog.c (constrain_operands): Accept a pseudo register before reload
+       for LRA enabled targets.
+
 2015-03-19  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/65240
index 7b5ca8b9f1e2b120498bd3878e44c69131970602..a9d3b1f779b50fd9ac42d82bb5ec33518a433f15 100644 (file)
@@ -2773,8 +2773,12 @@ constrain_operands (int strict, alternative_mask alternatives)
                           /* Every memory operand can be reloaded to fit.  */
                           && ((strict < 0 && MEM_P (op))
                               /* Before reload, accept what reload can turn
-                                 into mem.  */
+                                 into mem.  */
                               || (strict < 0 && CONSTANT_P (op))
+                              /* Before reload, accept a pseudo,
+                                 since LRA can turn it into a mem.  */
+                              || (strict < 0 && targetm.lra_p () && REG_P (op)
+                                  && REGNO (op) >= FIRST_PSEUDO_REGISTER)
                               /* During reload, accept a pseudo  */
                               || (reload_in_progress && REG_P (op)
                                   && REGNO (op) >= FIRST_PSEUDO_REGISTER)))
index 3cf6e024f5b8420a076158e88d7f060f5cffe4a8..776490096387356e9a8a56301b6c5b1a7348e795 100644 (file)
@@ -1,4 +1,9 @@
-2015-03-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
+2015-03-20  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/60851
+       * gcc.target/i386/pr60851.c: New test.
+
+2015-03-19  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/65240
        * gcc/testsuite/g++.dg/pr65240.h: Add tests for PR 65240.
diff --git a/gcc/testsuite/gcc.target/i386/pr60851.c b/gcc/testsuite/gcc.target/i386/pr60851.c
new file mode 100644 (file)
index 0000000..3b8d35d
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -flive-range-shrinkage -mtune=bdver4 -mdispatch-scheduler" } */
+
+long double ld (char c)
+{
+  return c;
+}