re PR tree-optimization/83581 (ICE in expand_LOOP_VECTORIZED, at internal-fn.c:2397)
authorJakub Jelinek <jakub@redhat.com>
Sun, 31 Dec 2017 23:53:17 +0000 (00:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 31 Dec 2017 23:53:17 +0000 (00:53 +0100)
PR tree-optimization/83581
* tree-loop-distribution.c (pass_loop_distribution::execute): Return
TODO_cleanup_cfg if any changes have been made.

* gcc.dg/pr83581.c: New test.

From-SVN: r256055

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

index a0c9bf86bb5c9b8f66d363c896dcf370268c1846..97c7a1084d3c87cee3b88e56163141de3f2d0436 100644 (file)
@@ -1,5 +1,9 @@
 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/83581
+       * tree-loop-distribution.c (pass_loop_distribution::execute): Return
+       TODO_cleanup_cfg if any changes have been made.
+
        PR middle-end/83608
        * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
        convert_modes if target mode has the right side, but different mode
index a9b2008f2d43a1e842576973e1d394524ffc58ef..416bcd592eb6c5f3f02fa385293a668e1cb077a4 100644 (file)
@@ -1,5 +1,8 @@
 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/83581
+       * gcc.dg/pr83581.c: New test.
+
        PR c/83595
        * gcc.dg/pr83595.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr83581.c b/gcc/testsuite/gcc.dg/pr83581.c
new file mode 100644 (file)
index 0000000..c145eff
--- /dev/null
@@ -0,0 +1,21 @@
+/* PR tree-optimization/83581 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-tree-copy-prop -fno-tree-loop-im" } */
+
+int a, b, c;
+
+int
+foo (int x)
+{
+  int *d = &x;
+  while (a < 1)
+    {
+      for (b = 0; b < 2; ++b)
+        {
+          *d += !!x + 1;
+          d = &c;
+        }
+      ++a;
+    }
+  return *d;
+}
index e195a46a36e311f29e7670005cba33a41a85b66f..bd780fa58e320a8cfc87b598260cd23d3040feab 100644 (file)
@@ -3103,7 +3103,7 @@ pass_loop_distribution::execute (function *fun)
 
   checking_verify_loop_structure ();
 
-  return 0;
+  return changed ? TODO_cleanup_cfg : 0;
 }
 
 } // anon namespace