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]

Re: Arranging for -Os to imply -mpreferred-stack-boundary=2 on x86


On Oct 24, 2001, Richard Henderson <rth@redhat.com> wrote:

> On Wed, Oct 24, 2001 at 05:08:00PM -0400, Geert Bosch wrote:
>> Yes, but without the alignment you'd have %ebp available as general
>> register, you would not need to save/restore it and set it up.
>> So, the cost of aligning the stack-pointer is one register and five 
>> instructions. How do you end up with only one instruction?

> Because we currently default to -fno-omit-frame-pointer for x86.
> So we currently never have %ebp available as a general register.

Besides, we could always arrange for the initial copying of incoming
arguments to pseudos such that the arguments ended up in aligned stack
slots, so %ebp would be available as a general register as soon as the
copy is done, if -fomit-frame-pointer is given.  But is it worth it?

Well, of course, this doesn't apply to variable arguments lists, that
would need a builtin data structure/pseudo to get to them anyway.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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