re PR tree-optimization/84650 ([graphite] ICE: Segmentation fault (in create_new_iv))
authorRichard Biener <rguenther@suse.de>
Mon, 5 Mar 2018 12:49:07 +0000 (12:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 5 Mar 2018 12:49:07 +0000 (12:49 +0000)
2018-03-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84650
* tree-ssa-loop-im.c (pass_lim::execute): Reset the SCEV cache
if executed in the loop pipeline.

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

From-SVN: r258242

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr84650.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c

index bd2c768820fb16e11ac5318903a3169d33755964..ba2a9c47e3ad1eff816da417a2744844114a2293 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-05  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/84650
+       * tree-ssa-loop-im.c (pass_lim::execute): Reset the SCEV cache
+       if executed in the loop pipeline.
+
 2018-03-05  Sandra Loosemore  <sandra@codesourcery.com>
 
        * doc/configfiles.texi (Configuration Files): Move info about
index 8e7e53b8546f425a8781031a471bfbc007b65165..48c40fa8f7f07e685a5e2a9d7359489efbcc4466 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-05  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/84650
+       * gcc.dg/graphite/pr84650.c: New testcase.
+
 2018-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/82022
diff --git a/gcc/testsuite/gcc.dg/graphite/pr84650.c b/gcc/testsuite/gcc.dg/graphite/pr84650.c
new file mode 100644 (file)
index 0000000..e59d161
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgraphite-identity -fno-tree-copy-prop --param lim-expensive=3" } */
+
+unsigned int dj;
+
+void
+np (void)
+{
+  const unsigned int uw = 2;
+  unsigned int eu;
+
+  for (eu = 0; eu < uw; ++eu)
+    {
+      for (dj = 0; dj < uw; ++dj)
+       ;
+      eu -= !!(dj - uw - 1);
+    }
+}
index 4655766ddbe0664c62f24bfd366a514846cbaeb8..030aac0b616330f27506234904082b52f164ef55 100644 (file)
@@ -2616,6 +2616,8 @@ pass_lim::execute (function *fun)
 
   if (!in_loop_pipeline)
     loop_optimizer_finalize ();
+  else
+    scev_reset ();
   return todo;
 }