This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: RFC: Turn on -fomit-frame-pointer and -fasynchronous-unwind-tables for Linux/i386


"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Thu, Jul 15, 2010 at 12:49 PM, Roland McGrath <roland@redhat.com> wrote:
>>> I updated the spread sheet with glibc 12.0 DSO sizes
>>> I think -fomit-frame-pointer and -fasynchronous-unwind-tables
>>> will increase size of DSO written in C by about 10%.
>>
>> Are you talking about code size or text size? ?Of course
>> -fasynchronous-unwind-tables increases the size of .eh_frame,
>> but that is not usually a performance issue. ?The actual code
>> size increase is what affects hot path cache load and so forth.
>
> -fomit-frame-pointer increases libc.so code size by 1%. We
> have to save/restore EBP when using it GPR. But for some reason,
> gcc will choose EBP even when ECX/EDX are available:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44958

Ideal would be if -Os could automatically switch on -fframe-pointer
when the function has many local variables on the stack
(reference through %rbp is one byte smaller than through another GPR)
and otherwise keep it off.

I believe MSVC does that and it's a useful optimization for x86.

But it's presumably hard to do in gcc because FP or no FP
gets decided fairly early. Still perhaps it could be done
with a heuristic?

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.


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