This is the mail archive of the gcc-patches@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: [PATCH] Alignment and split function args


On Friday 27 February 2004 9:37 am, Richard Henderson wrote:
> On Fri, Feb 27, 2004 at 01:22:30AM +0000, Paul Brook wrote:
> > On arm a and the first 3 words of b are passed in registers. The last
> > word of b, and c are passed on the stack. For some subtargets
> > STACK_BOUNDARY == 32, PREFERRED_STACK_BOUNDARY == 64, and long long types
> > require doubleword (64-bit) alignment.
>
> As Dan notes, this is simply broken.  PREFERRED_STACK_BOUNDARY is
> absolutely *not* guaranteed, merely preferred.

We need to change the documentation then.

From tm.texi:
"PREFERRED_STACK_BOUNDARY
Define this macro if you wish to preserve a certain alignment for the stack 
pointer, greater than what the hardware enforces.
[...]
[Either] the stack will always be aligned to the specified boundary [... or] 
the stack may be momentarily unaligned while pushing arguments."

> If long long absolutely has to have 64-bit alignment, you'd have
> to implement dynamic stack alignment, which gcc isn't set up to
> support well at all.  Or change the ABI.
>
> More likely, long long needn't actually have 64-bit alignment,
> since ARM doesn't.  Yes, you'd need it to use the iwmmxt insns,
> but is that absolutely required?  I think not.

I'm implementing the ARM EABI
http://www.armdevzone.com/EABI/bsabi.pdf

This requires 64-bit alignment for long long. It also requires 64-bit stack 
alignment on entry/exit from public symbols, and 32-bit stack alignment at 
all times.
This seems to be match what PREFERRED_STACK_BOUNDARY claims to do.

Paul


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