public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: Fix PR41906 (segfault in EH lowering)
@ 2009-11-26 16:51 Michael Matz
  2009-11-26 17:32 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Matz @ 2009-11-26 16:51 UTC (permalink / raw)
  To: gcc-patches

Hi,

with -fpermissive we accept catch-alls that aren't at the end of a catch 
chain, hence we shouldn't segfault on them.  Formerly we regarded them as 
unreachable (which indeed they are), and it's easy enough to continue to 
do so while lowering the EH constructs, so I don't think we should change 
the behaviour of -fpermissive in this regard.

Regstrapping on x86_64-linux (all langs+Ada) in progress.  Okay if that 
passes?


Ciao,
Michael.
-- 
	PR c++/41906
	* tree-eh.c (lower_catch): Stop after expanding a catch-all.

testsuite/
	* g++.dg/tree-ssa/pr41906.C: New testcase.

Index: tree-eh.c
===================================================================
--- tree-eh.c	(revision 154674)
+++ tree-eh.c	(working copy)
@@ -1666,6 +1666,8 @@ lower_catch (struct leh_state *state, gi
 	  x = gimple_build_goto (out_label);
 	  gimple_seq_add_stmt (&new_seq, x);
 	}
+      if (!c->type_list)
+	break;
     }
 
   gimple_try_set_cleanup (tp, new_seq);
Index: testsuite/g++.dg/tree-ssa/pr41906.C
===================================================================
--- testsuite/g++.dg/tree-ssa/pr41906.C	(revision 0)
+++ testsuite/g++.dg/tree-ssa/pr41906.C	(revision 0)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fpermissive -w" } */
+/* We aren't interested in the warning, but in the ICE.  */
+void foo();
+extern void abort (void);
+
+void bar()
+{
+  try { foo(); }
+  catch (...) {}
+  catch (int) {abort ();}
+}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: Fix PR41906 (segfault in EH lowering)
  2009-11-26 16:51 RFA: Fix PR41906 (segfault in EH lowering) Michael Matz
@ 2009-11-26 17:32 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2009-11-26 17:32 UTC (permalink / raw)
  To: Michael Matz; +Cc: gcc-patches

On Thu, Nov 26, 2009 at 5:50 PM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> with -fpermissive we accept catch-alls that aren't at the end of a catch
> chain, hence we shouldn't segfault on them.  Formerly we regarded them as
> unreachable (which indeed they are), and it's easy enough to continue to
> do so while lowering the EH constructs, so I don't think we should change
> the behaviour of -fpermissive in this regard.
>
> Regstrapping on x86_64-linux (all langs+Ada) in progress.  Okay if that
> passes?

Ok.

Thanks,
Richard.

>
> Ciao,
> Michael.
> --
>        PR c++/41906
>        * tree-eh.c (lower_catch): Stop after expanding a catch-all.
>
> testsuite/
>        * g++.dg/tree-ssa/pr41906.C: New testcase.
>
> Index: tree-eh.c
> ===================================================================
> --- tree-eh.c   (revision 154674)
> +++ tree-eh.c   (working copy)
> @@ -1666,6 +1666,8 @@ lower_catch (struct leh_state *state, gi
>          x = gimple_build_goto (out_label);
>          gimple_seq_add_stmt (&new_seq, x);
>        }
> +      if (!c->type_list)
> +       break;
>     }
>
>   gimple_try_set_cleanup (tp, new_seq);
> Index: testsuite/g++.dg/tree-ssa/pr41906.C
> ===================================================================
> --- testsuite/g++.dg/tree-ssa/pr41906.C (revision 0)
> +++ testsuite/g++.dg/tree-ssa/pr41906.C (revision 0)
> @@ -0,0 +1,12 @@
> +/* { dg-do compile } */
> +/* { dg-options "-fpermissive -w" } */
> +/* We aren't interested in the warning, but in the ICE.  */
> +void foo();
> +extern void abort (void);
> +
> +void bar()
> +{
> +  try { foo(); }
> +  catch (...) {}
> +  catch (int) {abort ();}
> +}
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-26 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-26 16:51 RFA: Fix PR41906 (segfault in EH lowering) Michael Matz
2009-11-26 17:32 ` Richard Guenther

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).