This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR 16660, attribute((aligned)) doesn't work for variables on the stack for greater than required alignment
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Andrew_Pinski at PlayStation dot Sony dot Com
- Cc: gcc-patches at gcc dot gnu dot org, Andrew Pinski <pinskia at gmail dot com>, Richard Henderson <rth at redhat dot com>, Russell_Olsen at playstation dot sony dot com, trevor_smigiel at playstation dot sony dot com
- Date: Tue, 9 Oct 2007 19:17:13 -0700
- Subject: Re: [PATCH] Fix PR 16660, attribute((aligned)) doesn't work for variables on the stack for greater than required alignment
- References: <20071010003130.GA3068@lucon.org> <OFF929985D.B18F8B4B-ON88257370.0003198B-88257370.000377C0@playstation.sony.com>
On Tue, Oct 09, 2007 at 05:37:52PM -0700, Andrew_Pinski@PlayStation.Sony.Com wrote:
> "H.J. Lu" <email@example.com> wrote on 10/09/2007 05:31:30 PM:
> > This patch doesn't solve the stack alignment problem on x86 where gcc
> > assumes the stack is 16byte aligned and ia32 psABI only specifies 4
> > byte alignment. To make gcc to conform ia32 psABI, we need to
> > align the stack when >4 byte alignment is needed for local variable
> > as well as register spill. If we align the stack, this patch isn't
> > needed for x86.
> Again how many times do I have to mention, the proposal above does not
> help out when you need a bigger alignment than what is required than
> 16byte alignment. If you take a look at the testcases which are added,
What did you mean by "what is required than 16byte alignment"?
The alignment reqiurement of a local variable is the alignment
reqiurement of its type which can be a structure, a scalar or a
vector type. My proposal treats the alignment reqiurement of
a structure the same as the alignment reqiurement of a scalar/vector
type. Why can't my proposal align stack to 256 byte?