re PR tree-optimization/87328 (ICE in do_rpo_vn, at tree-ssa-sccvn.c:6566)
authorRichard Biener <rguenther@suse.de>
Mon, 17 Sep 2018 13:28:04 +0000 (13:28 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 17 Sep 2018 13:28:04 +0000 (13:28 +0000)
2018-09-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87328
* tree-ssa-sccvn.c (process_bb): Remove assertion about not
visiting unexecutable backedges when not iterating.
(do_rpo_vn): Mark all edges not executable even when not
iterating.

* gcc.dg/torture/pr87328.c: New testcase.

From-SVN: r264369

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr87328.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c

index f653d66f28849b652dd91bff682f4f225d34668b..585056e5db83ba704e3156ef67961500553cd4dd 100644 (file)
@@ -1,3 +1,11 @@
+2018-09-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87328
+       * tree-ssa-sccvn.c (process_bb): Remove assertion about not
+       visiting unexecutable backedges when not iterating.
+       (do_rpo_vn): Mark all edges not executable even when not
+       iterating.
+
 2018-09-17  Martin Jambor  <mjambor@suse.cz>
 
        PR c/63886
index 4fd1ff928ab660f1985dcee6e969df56019a9be5..5cce863e58af3eeb8c85eaf0b74dad033c5199e4 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87328
+       * gcc.dg/torture/pr87328.c: New testcase.
+
 2018-09-17  Martin Jambor  <mjambor@suse.cz>
 
        PR c/63886
diff --git a/gcc/testsuite/gcc.dg/torture/pr87328.c b/gcc/testsuite/gcc.dg/torture/pr87328.c
new file mode 100644 (file)
index 0000000..50e1cdf
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fno-tree-ccp -fno-tree-forwprop" } */
+
+void
+tp (void)
+{
+  int qt;
+
+  qt = 0;
+  if (qt != 0)
+    {
+      if (0)
+       {
+h5:
+         qt = 0;
+         while (qt < 1)
+           {
+           }
+       }
+
+      ++qt;
+    }
+
+  goto h5;
+}
index a9e4d34e31f6f51864bf50d9d2a0d4a916f3bdfd..a49e7f6745138521f94ddd24f795036f20c1d9a1 100644 (file)
@@ -5978,7 +5978,6 @@ process_bb (rpo_elim &avail, basic_block bb,
                fprintf (dump_file,
                         "marking outgoing edge %d -> %d executable\n",
                         e->src->index, e->dest->index);
-             gcc_checking_assert (iterate || !(e->flags & EDGE_DFS_BACK));
              e->flags |= EDGE_EXECUTABLE;
              e->dest->flags |= BB_EXECUTABLE;
            }
@@ -6125,7 +6124,6 @@ process_bb (rpo_elim &avail, basic_block bb,
                         "marking known outgoing %sedge %d -> %d executable\n",
                         e->flags & EDGE_DFS_BACK ? "back-" : "",
                         e->src->index, e->dest->index);
-             gcc_checking_assert (iterate || !(e->flags & EDGE_DFS_BACK));
              e->flags |= EDGE_EXECUTABLE;
              e->dest->flags |= BB_EXECUTABLE;
            }
@@ -6148,7 +6146,6 @@ process_bb (rpo_elim &avail, basic_block bb,
                    fprintf (dump_file,
                             "marking outgoing edge %d -> %d executable\n",
                             e->src->index, e->dest->index);
-                 gcc_checking_assert (iterate || !(e->flags & EDGE_DFS_BACK));
                  e->flags |= EDGE_EXECUTABLE;
                  e->dest->flags |= BB_EXECUTABLE;
                }
@@ -6390,10 +6387,7 @@ do_rpo_vn (function *fn, edge entry, bitmap exit_bbs,
        {
          if (e->flags & EDGE_DFS_BACK)
            has_backedges = true;
-         if (! iterate && (e->flags & EDGE_DFS_BACK))
-           e->flags |= EDGE_EXECUTABLE;
-         else
-           e->flags &= ~EDGE_EXECUTABLE;
+         e->flags &= ~EDGE_EXECUTABLE;
          if (e == entry)
            continue;
          if (bb_to_rpo[e->src->index] > i)