This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((aligned(16)) on x86
- To: aoliva at redhat dot com, ryants at home dot com
- Subject: Re: __attribute__((aligned(16)) on x86
- From: mike stump <mrs at windriver dot com>
- Date: Mon, 30 Jul 2001 08:31:37 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org
> Date: Sat, 28 Jul 2001 02:03:56 -0700
> From: "Ryan T. Sammartino" <ryants@home.com>
> To: Alexandre Oliva <aoliva@redhat.com>
> When I have something on the stack that is aligned to a certain
> boundary, I expect the compiler to do something like:
> sub 8, %esp
> and -16, %esp
> add 4, %esp
> <now put variables on the stack>
You might expect that, but gcc doesn't have the beef to manage to do
this.
> Aligning the stack is no good, since if I do something like:
> char c;
> vector v1;
> my vector will be misaligned by sizeof(char).
You misunderstand. Examine how alignment of global data can work
with:
char c;
double d;
Hint, you pack c with and around other small things, and put d on an 8
boundary.