Re: Alignment of large structures in GCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew,

On 15 July 2008 Andrew Haley wrote:
> > I narrowed it down to the following example:
> >
> > <<<
> > struct {
> >         int xxx[NINT];
> > } aaa __attribute__((section(".foo")));
> > <<<<
>
> Please try making it a one-element array of that struct.  Does that
> fix your problem?

No, it doesn't.

struct {
        int xxx[NINT];
} aaa[1] __attribute__((section(".foo")));

$ gcc -o - -S gg.c -DNINT=9 | grep align
        .align 32

> > The question is, why does GCC perform such 32-byte alignment and is
> > it possible to turn off such behavior globally?
>
> What target is this?  It might be an ABI requirement, or just an
> optimization. Strictly speaking, gcc is allowed to do this.

$ gcc -dumpmachine
i386-redhat-linux

Best regards,
Alexey.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux