re PR tree-optimization/83563 ([graphite] ICE: Segmentation fault (in instantiate_sce...
authorRichard Biener <rguenther@suse.de>
Mon, 8 Jan 2018 15:04:53 +0000 (15:04 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 8 Jan 2018 15:04:53 +0000 (15:04 +0000)
2018-01-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83563
* graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
cache.

* gcc.dg/graphite/pr83563.c: New testcase.

From-SVN: r256343

gcc/ChangeLog
gcc/graphite.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr83563.c [new file with mode: 0644]

index b91925a712892bca6514b777cff6d758f4e2b52f..f8d2b34ea72a3e07adf25fee2674f4b205cd07f3 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/83563
+       * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
+       cache.
+
 2018-01-08  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/83713
index fb8437c4b895a3093a07473c97178fd479df7639..8208d3dc32b2495c446adb3ebfe2df684e0cae9f 100644 (file)
@@ -322,6 +322,10 @@ canonicalize_loop_closed_ssa_form (void)
   FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
     canonicalize_loop_closed_ssa (loop);
 
+  /* We can end up releasing duplicate exit PHIs and also introduce
+     additional copies so the cached information isn't correct anymore.  */
+  scev_reset ();
+
   checking_verify_loop_closed_ssa (true);
 }
 
index d5fd96d05c1c4662a130628a4245ac13ee637780..562b5a0053be5e72f505146b779a8d0190f5a9a5 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/83563
+       * gcc.dg/graphite/pr83563.c: New testcase.
+
 2018-01-08  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/83713
diff --git a/gcc/testsuite/gcc.dg/graphite/pr83563.c b/gcc/testsuite/gcc.dg/graphite/pr83563.c
new file mode 100644 (file)
index 0000000..c1ca39e
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgraphite -ftree-loop-distribution -fno-tree-dominator-opts -fno-tree-sink -fno-tree-dce" } */
+
+void
+sy (void)
+{
+  int hb;
+
+  for (hb = 1; hb != 0; hb += hb)
+    {
+    }
+
+  while (hb < 1)
+    ++hb;
+}