This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Altivec + 16 byte alignment
> Date: Tue, 11 Feb 2003 20:28:50 +0000
> From: Neil Booth <neil@daikokuya.co.uk>
> Geoff Keating wrote:-
>
> > At present, there's this code in assign_stack_local:
> >
> > /* Ignore alignment we can't do with expected alignment of the boundary. */
> > if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY)
> > alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
> >
> > but really that's wrong, and at a minimum it should warn the user
> > that their requested alignment isn't going to happen (better would be
> > to just ensure the requested alignment). We occasionally get bug
> > reports about this, but so far no-one has invested the effort to
> > implement arbitrary stack alignment.
>
> Isn't an even better place to do it in the front end, just after parsing
> the alignment request?
You could do it if you discovered that a user-requested stack local
needed more alignment than assign_stack_local can currently give,
but it's not clear to me that the front end will always have that
information, and certainly it doesn't have it when it's just seen the
alignment request; consider
struct foo {
int x __attribute__((aligned (512)));
}
which might, or might not, end up on the stack.
--
- Geoffrey Keating <geoffk@geoffk.org>