This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: attribute aligned(4) ignored


On Tue, 25 Jul 2005, Ian Lance Taylor wrote:
... the struct maintains its 8-byte alignment even though nothing
inside of it requires 8-byte alignment any more.

When I try that with a powerpc-eabi compiler, it appears to generates a struct with a size of 12 bytes and an alignment of 4 bytes. Do you not see that with a Darwin compiler? What target are you configuring for? What sources are you using?

This is a powerpc-darwin specific issue I believe. The Darwin ABI states (roughly) that doubles have 4-byte alignment, unless they are the first element of a structure (in which they have 8-byte alignment). I think this is a holdover from AIX compatibility.


It is my guess that this ABI rule is overruling the user request, but I don't really know how to go about verifying this, or working around it :(

-Chris

--
http://nondot.org/sabre/
http://llvm.org/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]