This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


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

Re: more patches


Zack Weinberg <zack@rabi.phys.columbia.edu> writes:

> I've never liked that restriction, especially on x86 where registers
> are so scarce.  Backtraces are likely to be useful in `production'
> code (print backtrace on internal error, with request to mail to
> author) where you wouldn't need full debuggability and might want the
> speed benefits of -fomit-frame-pointer.

It is absolutely unclear whether -fomit-frame-pointer really makes a
difference.  If you look at the timings you'll see that accessing the
stack through the %esp register is penalized in contrast to accessing
it through %ebp.  %esp is a special register with special dependencies
and this reflects in the execution time.

Therefore gcc has the -omit-leaf-frame-pointer option on Intel and
this is what I always use.  Leaf functions tend to be small and here
the difference between building the stack frame or not makes a
difference.  But since any situation in which backtrace() can be
called does not involve leaf functions (obviously) this option is a
good replacement to be used in production code.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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