Re: Alignment of large structures in GCC

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

 



Alexey Neyman wrote:
> 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

I have no idea why this is happening; it may be a bug.  I'd have to
debug gcc to find the place that's doing the 32-aligning.  There may be
a simple answer, but I can't think of one.

Andrew.


[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