Local optimization on i386 ?
Jamie Lokier
egcs@tantalophile.demon.co.uk
Wed Dec 1 05:04:00 GMT 1999
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
More information about the Gcc
mailing list