re PR target/82795 (ICE in predicate_mem_writes, at tree-if-conv.c:2251)
authorRichard Biener <rguenther@suse.de>
Thu, 2 Nov 2017 13:13:53 +0000 (13:13 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 2 Nov 2017 13:13:53 +0000 (13:13 +0000)
2017-11-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/82795
* tree-if-conv.c (predicate_mem_writes): Remove bogus assert.

* gcc.target/i386/pr82795.c: New testcase.

From-SVN: r254342

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr82795.c [new file with mode: 0644]
gcc/tree-if-conv.c

index af7aadee5d961f14e6aa3d64823bab99444ba6e6..cb46f71ce775bd60e6dd900556ae21eee8c77a4b 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-02  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/82795
+       * tree-if-conv.c (predicate_mem_writes): Remove bogus assert.
+
 2017-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * acinclude.m4 (gcc_AC_INITFINI_ARRAY): Don't require
index a8bb8caa0e5785ac5156743944b699714630b297..bf8845c063c7e81955b1c30c2ec39d7225ccf8d7 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-02  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/82795
+       * gcc.target/i386/pr82795.c: New testcase.
+
 2017-11-02  Claudiu Zissulescu <claziss@synopsys.com>
 
        * gcc.target/arc/loop-1.c: Add test.
diff --git a/gcc/testsuite/gcc.target/i386/pr82795.c b/gcc/testsuite/gcc.target/i386/pr82795.c
new file mode 100644 (file)
index 0000000..9e7fec7
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx2" } */
+
+void
+sj (int qh, int rn, int *by)
+{
+  for (;;)
+    if (qh != 0)
+      {
+       int dc;
+
+       for (dc = 0; dc < 17; ++dc)
+         {
+           int nn;
+
+           nn = (rn != 0) ? qh : dc;
+           if (nn != 0)
+             qh = nn;
+           else
+             qh = (qh != 0) ? *by : dc;
+         }
+      }
+}
index a1803ff43918abd1097e6058fe52f841570f08ca..c74c80305f9df56115b748df28fa4982fd3b40bb 100644 (file)
@@ -2247,10 +2247,7 @@ predicate_mem_writes (loop_p loop)
                                         TREE_OPERAND (cond, 0),
                                         TREE_OPERAND (cond, 1));
                  else
-                   {
-                     gcc_assert (TREE_CODE (cond) == SSA_NAME);
-                     mask = cond;
-                   }
+                   mask = cond;
 
                  if (swap)
                    {