This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Darwin gcc 3.3 sizeof of C++ structures with long long ints is strange
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: "Kevin B. Hendricks" <kevin dot hendricks at sympatico dot ca>
- Cc: Andrew Haley <aph at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 20 Mar 2003 00:44:02 -0500
- Subject: Re: Darwin gcc 3.3 sizeof of C++ structures with long long ints is strange
>>>>> Kevin B Hendricks writes:
Kevin> That's interesting to know. That means any AIX port of OOo would run into
Kevin> the same difficulties. Does the AIX gcc version support anything like
Kevin> -malign-natural does for Apple's gcc 3.1 (byte aligned to 1, short aligned
Kevin> to 2, int aligned to 4, double and long long int aligned to 8)?
Kevin> Any particular reason for treating long long ints differently from doubles?
The AIX port of GCC does not have the equivalent of
-malign-natural. IBM's Visual Age compiler may have a similar option
which could be provided for AIX GCC as well.
At the time the AIX ABI was being developed (late 1980's), 64-bit
"long long int" extension did not exist and double was the only 64-bit
quantity. The RIOS implementation of the POWER architecture could handle
word-aligned doubles, so the ABI architects decided why make "double" the
odd-ball with stricter alignment than all other types. By the time "long
long int" was introduced, they decided to be more forward-thinking, but
they could not break the ABI and correct "double" alignment.
David