This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Fix PR41906 (segfault in EH lowering)


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 ();}
> +}
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]