re PR target/89290 (ICE in change_address_1, at emit-rtl.c:2286)
authorJakub Jelinek <jakub@redhat.com>
Wed, 13 Feb 2019 08:45:37 +0000 (09:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 13 Feb 2019 08:45:37 +0000 (09:45 +0100)
PR target/89290
* config/i386/predicates.md (x86_64_immediate_operand): Allow
TLS UNSPECs offsetted by signed 32-bit CONST_INT even with
-mcmodel=large.

* gcc.target/i386/pr89290.c: New test.

From-SVN: r268837

gcc/ChangeLog
gcc/config/i386/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr89290.c [new file with mode: 0644]

index 533ab59b6bbf7df7f9f2c1421d1864a6c57427d8..832f1a3bb7bd7596d9b40f08cb87cbf8a869a6cf 100644 (file)
@@ -1,3 +1,10 @@
+2019-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/89290
+       * config/i386/predicates.md (x86_64_immediate_operand): Allow
+       TLS UNSPECs offsetted by signed 32-bit CONST_INT even with
+       -mcmodel=large.
+
 2019-02-13  Martin Liska  <mliska@suse.cz>
 
        PR lto/88858
index 807883e75d23b4cb4246230770db92db70270358..865947debcc879761d078c9df00db18ddbea50ec 100644 (file)
          rtx op1 = XEXP (XEXP (op, 0), 0);
          rtx op2 = XEXP (XEXP (op, 0), 1);
 
-         if (ix86_cmodel == CM_LARGE)
+         if (ix86_cmodel == CM_LARGE && GET_CODE (op1) != UNSPEC)
            return false;
          if (!CONST_INT_P (op2))
            return false;
index 43d84f68b49ed3084d2f3663feb9a6f14be600f6..bf9d01cc97887ca8c3147cbe68602e2270f8c891 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/89290
+       * gcc.target/i386/pr89290.c: New test.
+
 2019-01-23  Xiong Hu Luo  <luoxhu@linux.vnet.ibm.com>
 
        * gcc.target/powerpc/crypto-builtin-1.c
diff --git a/gcc/testsuite/gcc.target/i386/pr89290.c b/gcc/testsuite/gcc.target/i386/pr89290.c
new file mode 100644 (file)
index 0000000..89b26f2
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR target/89290 */
+/* { dg-do compile { target { tls && lp64 } } } */
+/* { dg-options "-O0 -mcmodel=large" } */
+
+struct S { long int a, b; } e;
+__thread struct S s;
+__thread struct S t[2];
+
+void
+foo (void)
+{
+  s = e;
+}
+
+void
+bar (void)
+{
+  t[1] = e;
+}