re PR tree-optimization/83435 (ICE in set_value_range, at tree-vrp.c:211)
authorRichard Biener <rguenther@suse.de>
Thu, 11 Jan 2018 13:42:29 +0000 (13:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 11 Jan 2018 13:42:29 +0000 (13:42 +0000)
2018-01-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83435
* graphite.c (canonicalize_loop_form): Ignore fake loop exit edges.
* graphite-scop-detection.c (scop_detection::get_sese): Likewise.
* tree-vrp.c (add_assert_info): Drop TREE_OVERFLOW if they appear.

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

From-SVN: r256535

gcc/ChangeLog
gcc/graphite-scop-detection.c
gcc/graphite.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr83435.c [new file with mode: 0644]
gcc/tree-vrp.c

index f27395d5e7f3f63356387c8e577b526e088064fd..6c8fdd1645f379af02080a653eb8be8e3bcfbc9d 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-11  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/83435
+       * graphite.c (canonicalize_loop_form): Ignore fake loop exit edges.
+       * graphite-scop-detection.c (scop_detection::get_sese): Likewise.
+       * tree-vrp.c (add_assert_info): Drop TREE_OVERFLOW if they appear.
+
 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
index b15b26dbb229c84a3b5f04082d1dab039d7ad62c..1f2f990b690d7f9f5dd62c201ebd32b75cdac91b 100644 (file)
@@ -428,7 +428,7 @@ scop_detection::get_sese (loop_p loop)
 
   edge scop_begin = loop_preheader_edge (loop);
   edge scop_end = single_exit (loop);
-  if (!scop_end || (scop_end->flags & EDGE_COMPLEX))
+  if (!scop_end || (scop_end->flags & (EDGE_COMPLEX|EDGE_FAKE)))
     return invalid_sese;
   /* Include the BB with the loop-closed SSA PHI nodes.
      canonicalize_loop_closed_ssa makes sure that is in proper shape.  */
index 3b7f46bebd6e4c56438cf0fc1fbdc0b7e7e4f616..bcf48284f755744043e67581b7d9d137d6015fa7 100644 (file)
@@ -324,7 +324,7 @@ canonicalize_loop_form (void)
   FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
     {
       edge e = single_exit (loop);
-      if (!e || (e->flags & EDGE_COMPLEX))
+      if (!e || (e->flags & (EDGE_COMPLEX|EDGE_FAKE)))
        continue;
 
       canonicalize_loop_closed_ssa (loop, e);
index afd7327b3d73b5e3aab26a2c3730c82a55d00f8c..fde8bcc383e19021f908a81884be21337eed95af 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-11  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/83435
+       * gcc.dg/graphite/pr83435.c: New testcase.
+
 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/pr83435.c b/gcc/testsuite/gcc.dg/graphite/pr83435.c
new file mode 100644 (file)
index 0000000..1b70c86
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=2 -floop-parallelize-all" } */
+
+int yj, ax;
+
+void
+gf (signed char mp)
+{
+  int *dh = &yj;
+
+  for (;;)
+    {
+      signed char sb;
+
+      for (sb = 0; sb < 1; sb -= 8)
+       {
+       }
+
+      mp &= mp <= sb;
+      if (mp == 0)
+       dh = &ax;
+      mp = 0;
+      *dh = 0;
+    }
+}
index 69762ab795e05d1c6ca3048978ef7192514e0055..3294bde9b94081e850b537b9caa1e24a2df0fa11 100644 (file)
@@ -2786,6 +2786,8 @@ add_assert_info (vec<assert_info> &asserts,
   assert_info info;
   info.comp_code = comp_code;
   info.name = name;
+  if (TREE_OVERFLOW_P (val))
+    val = drop_tree_overflow (val);
   info.val = val;
   info.expr = expr;
   asserts.safe_push (info);