PowerPC64 alignment of double in structs

Peter Bergner bergner at vnet.ibm.com
Mon Sep 22 12:14:32 EST 2003


Alan Modra wrote:
> On Wed, Sep 17, 2003 at 04:55:13PM -0500, Steve Munroe wrote:
>
>>On Wed, 2003-09-17 at 18:11, Alan Modra wrote:
>>
>>>http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01003.html is a proposal
>>>for fixing struct layout rules on powerpc64-linux-gcc to comply with
>>>the PowerPC64 Linux ABI.  The ABI specifies 4 byte alignment for
>>>doubles, which is a little surprising for someone without an AIX
>>>background, and isn't ideal for speed.  An alternative would be to
>>>change the ABI and gcc (and presumably xlc) to natural alignment.
>>>
>>>I'm interested in opinions..
>>
>>Unfortunately this change might break backward compatibility with existing
>>libraries.
>
>
> Yes, that's clear.  Did you read the gcc mailing list thread?  We're
> ABI incompatible *now* with xlc, and the rules xlc uses are not easy
> to follow.
>
> gcc-3.4 is an appropriate time to make an ABI change, because in
> fixing a bug with the way function args are passed, gcc already has
> a small ABI incompatibility with older gcc code.

Alan, are you saying xlc does or doesn't follow the ABI?  Aren't the "rules"
is uses just what is mandated by the ABI?

Mark, can you confirm what alignment xlc uses for doubles and long doubles?
Do you know whether xlc takes any special liberties with respect to the
PowerPC64 Linux ABI?

Given that xlc is already a shipping product we need to be carefull here.
It's one thing to cause an ABI compatibilty between new and old gcc code
because of a bug in gcc.  It would be another thing altogether to create an
incompatibility with xlc code because we changed the ABI underneath them.

We definiately need to come to a consensus before we do anything!


Peter


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list