This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A proposal to align GCC stack
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 19 Dec 2007 06:22:14 -0800
- Subject: Re: A proposal to align GCC stack
- References: <20071219091255.400BF73CC4@caffeine.csclub.uwaterloo.ca>
On Wed, Dec 19, 2007 at 04:12:55AM -0500, Ross Ridge wrote:
>
> I'm suggesting a different defintion of STACK_BOUNDARY which wouldn't,
> if strictly followed, result STACK_BOUNDARY being defined as 8 on
> the i386. The i386 hardware doesn't enforce a minimum alignment on the
> stack pointer.
On i386, you can only push/pop 2 or 4 bytes. On x86-64, you can only
push/pop 2 or 8 bytes.
> stack. In context of your proposal, defining STACK_BOUNDARY this way,
> as a requirement imposed on GCC by an ABI (or at least by convention),
> not the hardware, is important. Without an ABI requirement, there's
> nothing that would prohibit an i386 leaf function from adjusting the
> stack in a way that leaves the stack 1- or 2-byte aligned.
>
I don't mind changing the definition of STACK_BOUNDARY. It won't
affect our proposal. However, please don't use ABI when defining
STACK_BOUNDARY since a given hardware can have more than one ABIs
and only one STACK_BOUNDARY.
H.J.