This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: alignment bug in gcc i386 crtfastmath.c
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: hjl at lucon dot org (H. J. Lu)
- Cc: pinskia at physics dot uc dot edu (Andrew Pinski), gcc-patches at gcc dot gnu dot org, amir at boom dot org dot il (Amir Shalem)
- Date: Sat, 18 Mar 2006 11:58:17 -0500 (EST)
- Subject: Re: PATCH: alignment bug in gcc i386 crtfastmath.c
>
> On Sat, Mar 18, 2006 at 11:45:49AM -0500, Andrew Pinski wrote:
> >
> > On Mar 18, 2006, at 11:43 AM, Lu, Hongjiu wrote:
> >
> > >Can you try this patch?
> > >
> > >Since __attribute__ ((aligned (XX))) doesn't work for stack variables,
> > >is there a gcc option to warn it?
> >
> > Actually that is not true, it does work in general except when the stack
> > is required only to be not 16byte aligned.
> > I know on powerpc-darwin, it works for sure since there it is required
> > to
> > be 16byte aligned.
>
> I seem to remember that gcc doesn't do stack alignment adjustment and
> assumes the OS to set it up correctly. I can get segfault on Linux/ia32
> with -Os in crtfastmath.c.
Let me correct what I had meant, aligned does work on stack variables
when the aligned is smaller or equal to the required stack alignment
that the compiler can guaranteed. So don't say it does not work in
general because that is not true.
-- Pinski