This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A proposal to align GCC stack


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]