BUG: g++ 3.x.x -fomit-frame-pointer: exception handling doesn't work

James E Wilson wilson@specifixinc.com
Tue Aug 10 19:57:00 GMT 2004


On Tue, 2004-08-10 at 01:04, Denis Zaitsev wrote:
> > I never did get the first example to fail.
> It's very strange.  Did you use -O2?  The both examples utilize the
> same error...

Yes.

> navigation for me: where in GCC sources is the dwarf info (used for
> the exception handling) generated and emited into the object code?  I
> surely don't remember where I've found it last time.  And sources are
> _huge_...

Most of the dwarf2 code is in dwarf2out.c.  See for instance
output_call_frame_info.  There is various other except related stuff in
various other places.  except.c has general support for emitting code
for exception support.  The unwind* files contain runtime support code
for the stack unwinders.  libsupc++ contains the C++ library routines
for throwing and catching exceptions.

Since I can only reproduce the problem when gcc itself is compiled with
-fomit-frame-pointer, the problem could be that there are builtin
functions used by libsupc++ that only work when there is a frame
pointer.  If this is the case, then compiling that library with
-fno-omit-frame-pointer would solve the problem.  Alternatively, we can
figure out which builtin function requires the frame pointer, and modify
the gcc optimizer to ensure that there will be one when that builtin
function is used.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com




More information about the Gcc mailing list