This is the mail archive of the
mailing list for the GCC project.
RE: Enable -fomit-frame-pointer on i386
- From: Andrew Haley <aph at redhat dot com>
- To: "david daney" <ddaney at avtrex dot com>
- Cc: "Jan Hubicka" <hubicka at ucw dot cz>, "Jan Hubicka" <jh at suse dot cz>, <gcc-patches at gcc dot gnu dot org>, <rth at redhat dot com>
- Date: Mon, 9 Feb 2004 12:07:44 +0000
- Subject: RE: Enable -fomit-frame-pointer on i386
- References: <69397FFCADEFD94F8D5A0FC0FDBCBBDEF3E5@avtrex-server.hq.avtrex.com>
david daney writes:
> >> Jan Hubicka writes:
> >> > Hi,
> >> > in the case we are taking seriuosly the switch to omitting
> >> > frame pointer this time, I think we shall do it earlier than
> >> > later. This patch imitate what x86-64 does already so there
> >> > shall not be too many showstoppers. I verified that with
> >> > current CVS gdb I can debug without problems. (most of older
> >> > GDBs segfaults when seeing location lists)
> >> >
> >> > Bootstrapped/regtested i386, OK?
> >> Does this break backtrace() in glibc?
> >Unforutnately yes, see my other mail. I would suggest to simply copy
> >around the x86-64 backtrace implementation, I have it on my machine for
> >a while and it works.
> >The dependence in between libjava and glibc would be very anoying
> >tought. Perhaps we can simply replace use of backtrace() in libjava by
> >the Jakub's unwind based implementation to break the dependency on
> >targets where unwind info shall be available (ia-64/x86-64/i386/s390 at
> >I am just running the testsuite to see if and how many testsuite
> >regressions it will bring.
> Have you all looked at libjava/sysdep/dwarf2-backtrace.cc ?
> It is a drop in replacement for glibc's backtrace() that I wrote
> for the MIPS port. Since it uses the unwinder to generate the call
> trace, it works with -fomit-framepointer.
> It should work on any system that uses the dwarf2 unwinder and
> where glibc has weak linkage for its backtrace().
That's an alternative. However, there is some risk here: I have seen
bugs in some combinations of libgcc and glibc where the dwarf2
unwinder does not terminate at the end of the stack, but segfaults
instead. We run the risk of introducing new bugs, or rather revealing
old ones. Just testing this on a Linux system with new versions of
glibc won't reveal them. We'd need to test on many systems.
Also, the stack trace code is due for some major revision before
3.5. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12740.
The patch that Bryce says he's working on is going to make big changes
in this area: http://gcc.gnu.org/ml/java/2003-11/msg00005.html.
So, for the time being let's continue with the old unwinder code.
It's simple to force -fno-omit-frame-pointer for gcj on x86.