zero-overhead exception handling, -fomit-frame-pointer and other optimizations...

leon zadorin leonleon77@gmail.com
Thu Jan 7 11:34:00 GMT 2010


Hello all,

I have 2 simple questions w.r.t. zero-overhead exception handling in
GCC 4.x series.

Essentially, both questions relate to comparing the
performance-related effects of using "zero-overhead"
exception-handling vs a more c-like "error-code checking" code.

First question concerns "-fomit-frame-pointer" optimization option. I
recall that a while ago there was an issue where the use of such an
option was not compatible with dwarf-based EH.

Latest versions appear to accept this option on the command-line
(using gcc which has been built to use dwarf-based EH).

Does that mean that now one can have the full effect of
-fomit-frame-pointer optimization (on architectures which would
normally allow it without EH cases) -- now with EH as well?

Second question is a bit more in a "ballpark" area -- I would like to
get a general idea on how "zero-overhead" exception handling actually
impacts on the various optimizations that a compiler can perform --
i.e. would there be some quality degradation in the optimized code
when comparing 2 cases of code (identical to each other, with the
exception of EH being present).

I know that this is rather dependent on more specific examples, I just
would like to get a general feel for this -- namely the cases when the
exception is *not* thrown: whether the "zero-overhead" exception
implementation would *force* a compiler to *omit* (or somewhat reduce)
some optimization which it could, otherwise, make use of.

Kind regards
Leon.



More information about the Gcc-help mailing list