This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA (EH): PATCH to tree-eh to remove cleanups in must_not_throw
- From: Richard Henderson <rth at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 21 May 2010 12:27:22 -0700
- Subject: Re: RFA (EH): PATCH to tree-eh to remove cleanups in must_not_throw
- References: <4BF454A7.6050008@redhat.com>
On 05/19/2010 02:14 PM, Jason Merrill wrote:
> The C++0x FCD says in 15.5.1 [except.terminate]:
>
> "In the situation where the search for a handler (15.3) encounters the
> outermost block of a function with a noexcept-specification that does
> not allow the exception (15.4), it is implementation-defined whether the
> stack is unwound before std::terminate() is called."
>
> This freedom to not do unwinding before calling terminate means that we
> can omit EH cleanups inside a must-not-throw region, such as cleanups at
> the top level of a noexcept (or throw() with -fnothrow-opt) function. So
> the tree-eh.c change implements that, and the spec11.C change tests it.
>
> Tested x86_64-unknown-linux-gnu (all languages). OK for trunk?
> * tree-eh.c (cleanup_is_dead_in): New.
> (lower_try_finally): Don't generate a dead cleanup region.
> (lower_cleanup): Likewise.
Ok.
r~