This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [x86 PATCH] Mark builtin intrinsics as "nothrow"
- From: Andrew Haley <aph at redhat dot com>
- To: Andi Kleen <ak at suse dot de>
- Cc: Steven Bosscher <stevenb dot gcc at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 10 Feb 2007 11:10:06 +0000
- Subject: Re: [x86 PATCH] Mark builtin intrinsics as "nothrow"
- References: <1404.68.35.10.103.1171077243.squirrel@mail.eyesopen.com.suse.lists.egcs-patches> <200702101103.07058.steven.bosscher@gmail.com.suse.lists.egcs-patches> <p73bqk21dcg.fsf@bingen.suse.de>
Andi Kleen writes:
> Steven Bosscher <stevenb.gcc@gmail.com> writes:
>
> > On Saturday 10 February 2007 04:14, Roger Sayle wrote:
> > > The following simple patch tweaks i386.c's builtin_def function to
> > > annotate the back-end intrinsics as "nothrow", by setting the TREE_NOTHROW
> > > bit of their "decl". This allows for simplification of the CFG at the
> > > tree-level for C++ codes, such as in the example below:
> >
> > Is this really safe if the builtin may trap (e.g. builtins for division
> > vs. division by zero)?
>
> AFAIK OS signals cannot be safely caught by C++ exception handlers.
Sure they can. We've been doing this in libgcj for years.
Divide builtins must not be marked nothrow when compiling with
-fnon-call-exceptions.
Andrew.