re PR target/65593 (internal compiler error: in extract_insn, at recog.c:2343)
authorJakub Jelinek <jakub@redhat.com>
Fri, 27 Mar 2015 17:35:14 +0000 (18:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 27 Mar 2015 17:35:14 +0000 (18:35 +0100)
PR target/65593
* config/i386/i386.c (legitimize_pic_address): If base
is SYMBOL_REF or LABEL_REF using %rip addressing, force
it to reg to avoid PLUS of SYMBOL_REF/LABEL_REF and register.

* gcc.c-torture/compile/pr65593.c: New test.

From-SVN: r221741

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr65593.c [new file with mode: 0644]

index 05174d85b657c159276126b9ca15ad7c10689cd6..0fb06d645b81eadd1ff6d5c3559a4c85109a3eb3 100644 (file)
@@ -1,3 +1,10 @@
+2015-03-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/65593
+       * config/i386/i386.c (legitimize_pic_address): If base
+       is SYMBOL_REF or LABEL_REF using %rip addressing, force
+       it to reg to avoid PLUS of SYMBOL_REF/LABEL_REF and register.
+
 2015-03-27  Jan Hubicka  <hubicka@ucw.cz>
 
        PR target/65531
index 22bc81f165a64384a90053b6ddee3c5f0cd0018c..862bda529b8f6a8611ff3b1979baf39bab585909 100644 (file)
@@ -13881,6 +13881,12 @@ legitimize_pic_address (rtx orig, rtx reg)
                }
              else
                {
+                 /* For %rip addressing, we have to use just disp32, not
+                    base nor index.  */
+                 if (TARGET_64BIT
+                     && (GET_CODE (base) == SYMBOL_REF
+                         || GET_CODE (base) == LABEL_REF))
+                   base = force_reg (mode, base);
                  if (GET_CODE (new_rtx) == PLUS
                      && CONSTANT_P (XEXP (new_rtx, 1)))
                    {
index 3409c9641756324c2619482dae10949a0ff1c72d..4fb0e221e831db5b07a16f3dee182c02878a5444 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/65593
+       * gcc.c-torture/compile/pr65593.c: New test.
+
 2015-03-27  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/59329
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr65593.c b/gcc/testsuite/gcc.c-torture/compile/pr65593.c
new file mode 100644 (file)
index 0000000..e72889d
--- /dev/null
@@ -0,0 +1,4 @@
+/* PR target/65593 */
+/* { dg-additional-options "-fpie" { target pie } } */
+
+#include "pr20928.c"