Bug 25630 - darwin-ppc, wrong alignment of nested structs
Summary: darwin-ppc, wrong alignment of nested structs
Status: RESOLVED DUPLICATE of bug 23067
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ABI, wrong-code, xfail
Depends on:
Blocks:
 
Reported: 2006-01-01 20:35 UTC by Andreas Tobler
Modified: 2006-10-16 21:46 UTC (History)
4 users (show)

See Also:
Host:
Target: powerpc-*-darwin*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-01 20:36:16


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Tobler 2006-01-01 20:35:17 UTC
darwin-ppc gets the alignment of nested structs wrong if they contain long long or double members.

The apple compiler, gcc version 4.0.1 (Apple Computer, Inc. build 5247)
does it 'correctly'.

Here an example for a wrong alignment:

struct A {long long a; unsigned char b;};
struct D {unsigned char y; struct A x; unsigned char z;};
struct E {long long d; unsigned char e;};

struct y { struct A b2; struct D b3; struct E b4;};

The apple output of sizeof(y) is 56, the current fsf gcc head gives: 64.

I put a few sample test cases into gcc.target/powerpc/darwin-abi-3...11.c on main.
Comment 1 Andrew Pinski 2006-01-01 20:36:16 UTC
Confirmed.
Comment 2 Geoff Keating 2006-10-16 21:46:57 UTC
I think this is a dup of bug 23067; they have the same underlying problem, which is that FSF GCC doesn't emulate the Apple GCC algorithm for structure layout exactly.

*** This bug has been marked as a duplicate of 23067 ***