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: [x86 PATCH] Mark builtin intrinsics as "nothrow"


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.


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