This is the mail archive of the gcc@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: C++ exception handling optimization performance


Hi,
> Hello all,
> 
> With gcc, does the fact that some branch results in a C++ exception
> effect the performance of a function when that exception branch
> isn't entered? In other words, does the presence of a throw effect
> the optimizer in any way?

EH handling is implemented in a way minimizing performance impact on code paths
not involving exceptions (and having considerable cost when exception is
thrown). It is not fully free however. Presence of throw usually imply presence
of cleanup regions (calling destructors) that increases function size and may
in turn prevent some optimizations over the non-EH path such as inlining,
because code gets too large.

Honza
> 
> -- David Sankel
> 
> -- 
> David Sankel <david@stellarscience.com>
> Stellar Science Ltd Co - Stellar Scientific Software Solutions
> 


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