public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR81659
@ 2017-10-26 15:39 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-10-26 15:39 UTC (permalink / raw)
  To: gcc-patches


The following fixes lower_eh_dispatch destroying dominator info
that was still live from previous passes.  This clears it from the
obvious place (when we think we might have created unreachable blocks).

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2017-10-26  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.

Index: gcc/tree-eh.c
===================================================================
--- gcc/tree-eh.c	(revision 254099)
+++ gcc/tree-eh.c	(working copy)
@@ -3779,7 +3779,10 @@ pass_lower_eh_dispatch::execute (functio
     }
 
   if (redirected)
-    delete_unreachable_blocks ();
+    {
+      free_dominance_info (CDI_DOMINATORS);
+      delete_unreachable_blocks ();
+    }
   return flags;
 }
 
Index: gcc/testsuite/g++.dg/torture/pr81659.C
===================================================================
--- gcc/testsuite/g++.dg/torture/pr81659.C	(nonexistent)
+++ gcc/testsuite/g++.dg/torture/pr81659.C	(working copy)
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+void
+a (int b)
+{
+  if (b)
+    throw;
+  try
+    {
+      a (3);
+    }
+  catch (int)
+    {
+    }
+  catch (int)
+    {
+    }
+}
+

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-26 15:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26 15:39 [PATCH] Fix PR81659 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).