This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: x86 Linux stack alignment requirement
- From: "H. J. Lu" <hjl at lucon dot org>
- To: "Menezes, Evandro" <evandro dot menezes at amd dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 8 Jun 2006 17:24:30 -0700
- Subject: Re: x86 Linux stack alignment requirement
- References: <84EA05E2CA77634C82730353CBE3A8430564A676@SAUSEXMB1.amd.com>
On Thu, Jun 08, 2006 at 05:25:32PM -0500, Menezes, Evandro wrote:
> > > 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.
>
> It would still be possible for the function to align its stack to 16 bytes, even though it can only assume it to be aligned at 4 bytes upon entry, if it needs it. Much like -mstackrealign, but paying its cost only in functions that will benefit from it.
>
That is what icc does. It will be very nice if gcc can do that.
H.J.