re PR tree-optimization/87301 (ICE: verify_gimple failed (error: statement marked...
authorRichard Biener <rguenther@suse.de>
Mon, 17 Sep 2018 10:21:21 +0000 (10:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 17 Sep 2018 10:21:21 +0000 (10:21 +0000)
2018-09-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87301
* tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_cleanup): Properly
clean EH info from leftover copy assignments.

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

From-SVN: r264364

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

index 3b6af9ed48555a773f9fef9ba57fcd9b5cd181a1..738f0c3fbb5a0f3548c12ac1504b2b8a66bf8268 100644 (file)
@@ -1,3 +1,9 @@
+2018-09-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87301
+       * tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_cleanup): Properly
+       clean EH info from leftover copy assignments.
+
 2018-09-17  Martin Liska  <mliska@suse.cz>
 
        PR gcov-profile/85871
index c40fc5f692c5e85b710a41880cf7b04ef2d4266a..bcb851a22c596e3373a4ad0c78a3fddebfaa76f4 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87301
+       * gcc.dg/torture/pr87301.c: New testcase.
+
 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/85954
diff --git a/gcc/testsuite/gcc.dg/torture/pr87301.c b/gcc/testsuite/gcc.dg/torture/pr87301.c
new file mode 100644 (file)
index 0000000..67d914f
--- /dev/null
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Wno-div-by-zero" } */
+
+void
+bl (int *be)
+{
+  int lo;
+    {
+      int **ny;
+
+      if (*be == 0)
+       {
+         int ***k8 = &ny;
+         int uj = (__INTPTR_TYPE__)&lo;
+
+         for (;;)
+           if (***k8 == 0)
+             {
+               uj = !!(1 / 0) ? !(lo = 0) : 0;
+               (void) uj;
+
+               if (*ny == 0)
+                 for (;;)
+                   if (***k8 == 0)
+                     {
+                     }
+
+               for (lo = 0; lo < 2; ++lo)
+                 {
+                 }
+             }
+       }
+    }
+}
index 1c95306fd821bb200c9cebd84eae1ec2f68f963d..a9e4d34e31f6f51864bf50d9d2a0d4a916f3bdfd 100644 (file)
@@ -5461,7 +5461,10 @@ eliminate_dom_walker::eliminate_cleanup (bool region_p)
                if (is_gimple_assign (stmt))
                  {
                    gimple_assign_set_rhs_from_tree (&gsi, sprime);
-                   update_stmt (gsi_stmt (gsi));
+                   stmt = gsi_stmt (gsi);
+                   update_stmt (stmt);
+                   if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
+                     bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
                    continue;
                  }
                else