PATCH: alignment bug in gcc i386 crtfastmath.c

H. J. Lu hjl@lucon.org
Sat Mar 18 17:39:00 GMT 2006


On Sat, Mar 18, 2006 at 12:30:01PM -0500, Andrew Pinski wrote:
> 
> On Mar 18, 2006, at 12:19 PM, H. J. Lu wrote:
> >What is the the required stack alignment that the compiler can
> >guaranteed when not all files are compiled at the same time with
> >the same option by the same person? Basically, compiler doesn't
> >really know for sure what the stack alignment at the function
> >entry point is.
> 
> Well the compiler cannot guarantee the stack alignment on x86 because
> the ABI says it is only required to be 4 byte aligned.  On other
> targets like PowerPC, the compile has to guarantee a stack alignment of
> 16bytes as it is required by the ABI.

So should gcc warn/error __attribute__ ((aligned (XX))) on stack
variables where XX is greater than the ABI requirement?


H.J.



More information about the Gcc-patches mailing list