This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Alignment and split function args
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Paul Brook <paul at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Richard Earnshaw <rearnsha at arm dot com>
- Date: Fri, 27 Feb 2004 12:18:40 +0000
- Subject: Re: [PATCH] Alignment and split function args
- Organization: ARM Ltd.
- Reply-to: Richard Earnshaw <rearnsha at arm dot com>
> 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.
>
> 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.
No, it just has to maintain stack alignment in all non-leaf functions.
The only routines that have to dynamically realign the stack are interrupt
handlers or something else that may occur asynchronously and be given a
stack that may be in a transient state.
> Or change the ABI.
Ain't gonna happen.
> 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.
On ARM Architecture 5e an ldrd instruction can only be used on a 64-bit
aligned address (strictly speaking it's implementation defined, but there
exist implementations that enforce this). This restriction is relaxed in
architecture 6, but it's still recommended for efficiency.
R.