This is the mail archive of the gcc@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: Local optimization on i386 ?


hubicka@horac.ta.jcu.cz wrote:
> I would like to do some simple interfunction optimization stuff

At the moment the default stack alignment is 16 and everyone has to
stick with that otherwise something that needs it may be called without
it.  That's unfortunate: everyone has to align stacks even though it's
rarely useful, and it's quite easy to end up calling a function with a
misaligned stack (say if you use a library that's uses a lesser
alignment).

I would like to see functions that need large stack alignment do the
alignment within themselves, using `and'.  Those functions can use %ebp
for arguments and locals that don't need the alignment, and %esp for
local slots that need the larger alignment.  The other way around is
also possible.

Result: the alignments can be omitted from most code, and code that
benefits from the alignments will always get it.

What do you think?
-- Jamie

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