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: RFC: C++ PATCH to stop emitting code for throw() by default


Jason Merrill wrote:
> On 03/22/2010 01:01 PM, Mark Mitchell wrote:
>> I recognize that we're talking about an intentionally non-conformant
>> mode here; the EH equivalent of -ffast-math or some such.  Are you
>> proposing that this be the default?
> 
> Yes.

It seems like a useful optimization, especially for space.

However, I'm generally opposed to make our default behavior be
incompatible with the standard.  Extensions to accept non-standard code
is one thing, but changing the behavior of a conforming program seems
like a bad idea to me.  And, I'm also opposed to backwards-incompatible
changes.  So, I think that this should be an optimization option, like
-ffast-math, not a default.

>> Also, how do we know that emitting nothing will result in a call to
>> terminate?  Perhaps our caller has an exception handler that will catch
>> this exception?
> 
> Because the function can't throw, no unwind information is emitted for
> calls to the function, so the unwinder can't unwind through the call and
> calls terminate.

Isn't that a GCC-specific assumption?  So that we can't be sure that
this will work with another compiler that implements the ABI?  If so,
that seems like another reason that this should not be a default.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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