On Wed, Jun 07, 2006 at 06:38:52PM -0500, Menezes, Evandro wrote: > > > > > > We have several choices for stack alignment requirement > > > > > > > > > > > > 1. Leave it unchanged. Gcc can do > > > > > > a. Nothing. Let the program crash. > > > > > > b. Align stack to 16byte if XMM registers are > > used locally and > > > > > > aren't passed down as function arguments. > > > > > > > > > > Why not so if the XMM registers are passed down as arguments? > > > > > > > > When calling a function with XMM register arguments, > > doesn't caller > > > > have to align stack to 16byte for callee? > > > > > > Not necessarily, I think. Just like the caller aligned its > > stack to 16 bytes, the callee can do the same while still > > assuming the 4-byte alignment. And it's an even lesser > > problem with -msseregparm or the sseregparam attribute. > > > > How are XMM arguments passed by default? What happens when there are > > more 16 XMM parameters? > > Is XMM supported with variable argument list? > > I see. Provided a local is passed in a register to a non-vararg function, it > is still OK to align the stack.
Given that we don't support 4 byte aligned stack at all with XMM regisrers, I would prefer to increase Linux/x86 stack alignment to 16 byte. People can use 4 byte alignment if they want. As for the existing 4 byte aligned code, -mstackrealign can be used to support them. H.J.