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:29:55 -0800
- Subject: Re: A proposal to align GCC stack
- References: <20071219091259.B7FDD73D10@caffeine.csclub.uwaterloo.ca>
On Wed, Dec 19, 2007 at 04:12:59AM -0500, Ross Ridge wrote:
>
> >STACK_BOUNDARY is the minimum stack boundary. MAX(STACK_BOUNDARY,
> >PREFERRED_STACK_BOUNDARY) == PREFERRED_STACK_BOUNDARY. So the question is
> >if we should assume INCOMING == PREFERRED_STACK_BOUNDARY in all cases:
>
> Doing this would also remove need for ABI_STACK_BOUNDARY in your proposal.
In our proposal, ABI_STACK_BOUNDARY provides the default value for
PREFERRED_STACK_BOUNDARY. It can be different for different OSes.
For a given OS, you can change PREFERRED_STACK_BOUNDARY. But you can't
change ABI_STACK_BOUNDARY. You can think it as software STACK_BOUNDARY.
>
> >Pros:
> > 1. Keep the current behaviour of -mpreferred-stack-boundary.
> >
> >Cons:
> > 1. The generated code is incompatible with the other object files.
>
> Well, your proposal wouldn't completely solve that problem, either.
> You can't guarantee compatiblity with object files compiled with different
> values -mpreferred-stack-boundary, including those compiled with current
> implementation, unless you assume the incomming stack is aligned to
> the lowest value the flag can have and align the outgoing stack to the
> highest value that the flag can have.
We can align the outgoing stack to PREFERRED_STACK_BOUNDARY and assume
INCOMING = MIN (ABI_STACK_BOUNDARY, PREFERRED_STACK_BOUNDARY), which
is our original proposal.
H.J.