re PR tree-optimization/81799 (ICE on valid code at -O3: verify_gimple failed)
authorBin Cheng <bin.cheng@arm.com>
Mon, 14 Aug 2017 11:46:03 +0000 (11:46 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Mon, 14 Aug 2017 11:46:03 +0000 (11:46 +0000)
PR tree-optimization/81799
* tree-loop-distribution.c (version_loop_by_alias_check): Force
cond_expr to simple gimple operand.

gcc/testsuite
* gcc.dg/tree-ssa/pr81799.c: New.

From-SVN: r251088

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr81799.c [new file with mode: 0644]
gcc/tree-loop-distribution.c

index 19bb575bf8f8b171ae4a3c89e864182a148fcb40..a380b40450b24495c4387370e437287607a23b74 100644 (file)
@@ -1,3 +1,9 @@
+2017-08-14  Bin Cheng  <bin.cheng@arm.com>
+
+       PR tree-optimization/81799
+       * tree-loop-distribution.c (version_loop_by_alias_check): Force
+       cond_expr to simple gimple operand.
+
 2017-08-14  Wilco Dijkstra  <wdijkstr@arm.com>
 
        PR middle-end/46932
index 8995806e289aca47c4aac786f1fb9e983b5f64b1..9309b483517aba8ca65b20382aa3071d21a3edde 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-14  Bin Cheng  <bin.cheng@arm.com>
+
+       PR tree-optimization/81799
+       * gcc.dg/tree-ssa/pr81799.c: New.
+
 2017-08-14  Wilco Dijkstra  <wdijkstr@arm.com>
 
        PR middle-end/46932
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81799.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81799.c
new file mode 100644 (file)
index 0000000..543ae94
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int printf (const char *, ...);
+
+int a, c[1], d, e, **f;
+
+void fn1 (int h)
+{
+  int *i = 0;
+  for (d = 0; d < 1; d++)
+    {
+      if (d)
+        continue;
+      for (; e; e++)
+        {
+          a = c[*i];
+          if (h)
+            printf ("0");
+        }
+      return;
+    }
+  f = &i;
+}
+
index 8d80cccf38f919ad675791a2c175e1c76ff5b5f2..b1b293419b008fad5f9f7303450e2b5f12dc03b0 100644 (file)
@@ -2263,7 +2263,7 @@ version_loop_by_alias_check (struct loop *loop, vec<ddr_p> *alias_ddrs)
   compute_alias_check_pairs (loop, alias_ddrs, &comp_alias_pairs);
   create_runtime_alias_checks (loop, &comp_alias_pairs, &cond_expr);
   cond_expr = force_gimple_operand_1 (cond_expr, &cond_stmts,
-                                     is_gimple_condexpr, NULL_TREE);
+                                     is_gimple_val, NULL_TREE);
 
   /* Depend on vectorizer to fold IFN_LOOP_DIST_ALIAS.  */
   if (flag_tree_loop_vectorize)