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: [PATCH] Omit frame pointer and fix %ebp by default on x86 (take3)


On Mon, 16 Aug 2004, Richard Henderson wrote:
> On Mon, Aug 16, 2004 at 12:16:12PM -0600, Roger Sayle wrote:
> > Are you arguing that
> > we should just make full "-fomit-frame-pointer" the default and
> > just require backtrace users (and the libraries they rely on) to
> > use the appropriate command line options?
>
> I am asking if an empty backtrace is any better than a broken backtrace,
> but that is the implication, yes.

Its a compromise but not one I feel strongly about.

Its also one of graceful degradation.  If a stack walker reaches the
end of a stack trace without finding an exception handler, it may
choose to ignore the exception, report to a log file, call destructors
exit gracefully etc... Hitting a hard fault from a corrupt stack
chain doesn't give the programmer these freedoms.

The backtrace need not be completely empty.  A gcj application that's
built with -fno-omit-frame-pointer can be linked against a C library,
such as glibc, built without frame pointers, and still function
correctly.  In a large application, only those functions that need
to appear in a stack trace, need be compiled "-fno-omit-frame-pointer".
If by default, we allowed %ebp to be clobbered arbitrarily we wouldn't
be able to intermix code.



If would prefer to approve a  patch to make full -fomit-frame-pointer
the default, there's a suitable patch to do that posted here:
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01172.html


By my reckoning, I've now contributed well over 500 patches to GCC, but
I suspect that omitting the frame pointer by default on x86 will be the
most significant improvement to the community over that entire career.
The number of codes that fail to use "-fomit-frame-pointer" and/or
"-ffast-math" make GCC only competative when in the hands of small elite
of power users.

Roger
--


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