re PR middle-end/81659 (ICE in verify_dominators, at dominance.c:1184)
authorRichard Biener <rguenther@suse.de>
Fri, 27 Oct 2017 08:03:16 +0000 (08:03 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 27 Oct 2017 08:03:16 +0000 (08:03 +0000)
2017-10-27  Richard Biener  <rguenther@suse.de>

PR middle-end/81659
* tree-eh.c (pass_lower_eh_dispatch::execute): Free dominator
info when we redirected EH.

* g++.dg/torture/pr81659.C: New testcase.

From-SVN: r254136

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr81659.C [new file with mode: 0644]
gcc/tree-eh.c

index e9418ee..5f33699 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-27  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/81659
+       * tree-eh.c (pass_lower_eh_dispatch::execute): Free dominator
+       info when we redirected EH.
+
 2017-10-26  Michael Collison  <michael.collison@arm.com>
 
        * config/aarch64/aarch64.md(<optab>_trunc><vf><GPI:mode>2):
index a545b7f..bafe8fd 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-27  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/81659
+       * g++.dg/torture/pr81659.C: New testcase.
+
 2017-10-26  Michael Collison  <michael.collison@arm.com>
 
        * gcc.target/aarch64/fix_trunc1.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/torture/pr81659.C b/gcc/testsuite/g++.dg/torture/pr81659.C
new file mode 100644 (file)
index 0000000..3696957
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+void
+a (int b)
+{
+  if (b)
+    throw;
+  try
+    {
+      a (3);
+    }
+  catch (int)
+    {
+    }
+  catch (int)
+    {
+    }
+}
+
index e255e08..1b0612b 100644 (file)
@@ -3779,7 +3779,10 @@ pass_lower_eh_dispatch::execute (function *fun)
     }
 
   if (redirected)
-    delete_unreachable_blocks ();
+    {
+      free_dominance_info (CDI_DOMINATORS);
+      delete_unreachable_blocks ();
+    }
   return flags;
 }