re PR target/90547 (ICE in gen_lowpart_general, at rtlhooks.c:63)
authorUros Bizjak <ubizjak@gmail.com>
Tue, 21 May 2019 17:57:11 +0000 (19:57 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 21 May 2019 17:57:11 +0000 (19:57 +0200)
PR target/90547
* config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
Avoid calling gen_lowpart with CONST operand.

testsuite/ChangeLog:

PR target/90547
* gcc.target/i386/pr90547.c: New test.

From-SVN: r271479

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

index 52178fefa7cb3a17b0ee936b2bb8df262124c167..8a89dc8b943058267e26d12ee2ee20a7074e9e6b 100644 (file)
@@ -1,3 +1,9 @@
+2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR target/90547
+       * config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
+       Avoid calling gen_lowpart with CONST operand.
+
 2019-05-21  Alexandre Oliva <aoliva@redhat.com>
 
        * tree-ssa-threadupdate.c (struct ssa_local_info_t): Add
index 2e6329a3890aaa954dda2ee40e453e508ed843f6..da5163de80e68e6ef728ede3364d7be520faaa21 100644 (file)
       operands[2] = shallow_copy_rtx (operands[2]);
       PUT_MODE (operands[2], SImode);
     }
+  else if (GET_CODE (operands[2]) == CONST)
+    {
+      /* (const:DI (plus:DI (symbol_ref:DI ("...")) (const_int N))) */
+      operands[2] = copy_rtx (operands[2]);
+      PUT_MODE (operands[2], SImode);
+      PUT_MODE (XEXP (operands[2], 0), SImode);
+      PUT_MODE (XEXP (XEXP (operands[2], 0), 0), SImode);
+    }    
   else
     operands[2] = gen_lowpart (SImode, operands[2]);
 })
index 4e8e73cb52f9cb27235ed3b38b3cbe441b4a1c22..b2781fa0f0bf55e62f1cb7ec1c0fc3806d4bd943 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR target/90547
+       * gcc.target/i386/pr90547.c: New test.
+
 2019-05-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * gcc.dg/Wattribute-alias.c: Pass emtpy arg to dg-require-ifunc.
diff --git a/gcc/testsuite/gcc.target/i386/pr90547.c b/gcc/testsuite/gcc.target/i386/pr90547.c
new file mode 100644 (file)
index 0000000..fcfe669
--- /dev/null
@@ -0,0 +1,21 @@
+/* PR target/90547 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo ()
+{
+  void *g[] = {&&a, &&b};
+
+  for (unsigned c = 0x1F;; c >>= 1)
+    {
+      unsigned d = (long)("a"+1);
+      long e = 8;
+
+      while (e)
+        {
+          a: goto *g[c&d];
+          b: e--;
+        }
+    }
+}