This is the mail archive of the
mailing list for the GCC project.
Re: Structure Alignment Bug in Sparc.
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: "Nitin Gupta" <ngupta at GlobespanVirata dot com>
- Cc: "Richard Henderson" <rth at redhat dot com>, gcc-bug at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Tue, 19 Aug 2003 11:00:11 -0400
- Subject: Re: Structure Alignment Bug in Sparc.
>>>>> Nitin Gupta writes:
Nitin> What causes compiler to assume that if a structure contains
Nitin> "long long" (64 bit) member any where (and not as the first member)
Nitin> then the start of the sturct will also be aligned a 8 byte boundary.
That is defined by the ABI. Most ABIs define the alignment of
types as their natural alignment and propagate the largest (strictest)
alignment into aggregates. The ABI for your Sparc-based system presumably
uses that model. If you want to change the alignment of a structure
member from the default, you need to use compiler extensions.