Bug 25299 - Another ABI incompatibility with Apple's gcc
Summary: Another ABI incompatibility with Apple's gcc
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ABI, rejects-valid, wrong-code
Depends on:
Blocks:
 
Reported: 2005-12-07 19:57 UTC by Andrew Pinski
Modified: 2005-12-12 20:17 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-darwin
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-12-07 19:57:45 UTC
The following source should compile on powerpc-darwin with no errors:
struct a {  double a[2]; int i; };
struct b { double a; double b; int i; };
int g[sizeof(struct a) == sizeof(struct b)?1:-1];

But currently it does not because we don't take into account that the type of the array.
Comment 1 Andrew Pinski 2005-12-07 20:26:19 UTC
From the sound of it, AIX has the same issue.  I have the simple fix but I cannot test it.
Comment 2 Alan Modra 2005-12-08 13:05:53 UTC
Your testcase fails on powerpc64-linux with -malign-power
Comment 3 Alan Modra 2005-12-12 01:28:55 UTC
Subject: Bug 25299

Author: amodra
Date: Mon Dec 12 01:28:50 2005
New Revision: 108393

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108393
Log:
	PR target/25299
	* config/rs6000/rs6000.c (rs6000_special_round_type_align): Increase
	alignment to doubleword if the first field is a double array.
	* config/rs6000/linux64.h (TARGET_ALIGN_NATURAL): Define.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/linux64.h
    trunk/gcc/config/rs6000/rs6000.c

Comment 4 Andrew Pinski 2005-12-12 19:28:16 UTC
Fixed.