Bug 65833

Summary: gcc does handles __attribute__ ((aligned (n))) differently than other gcc releases
Product: [Retired] Red Hat Linux Reporter: Joseph Kain <jkain>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-06-02 02:42:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joseph Kain 2002-06-02 02:42:53 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020531

Description of problem:
When compiled with egcs-1.1.2, gcc-2.95.3, and gcc-3.0 the program below outputs
16.  When compiled with gcc-2.96 from package gcc-2.96-110 the program outputs
12.  This makes object files compile with gcc-2.96 incompatible with object
files compiled with other versions of gcc.

#include <stdio.h>

typedef long long int aint __attribute__ ((aligned (8)));

struct s {
  int i;
  aint a;
};

int
main () {
  printf ("%d\n", sizeof (struct s));
}

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Save program text to align.c
2. Run gcc -o align align.c
3. Run ./align
	

Actual Results:  The program printed out 12

Expected Results:  I expected the program to print out 16.

Additional info:

Comment 1 Jakub Jelinek 2002-06-04 09:16:59 UTC
There is nothing that can be done about this at this point. Changing this would
mean binary incompatibility within 2.96-RH series, which I consider a worse thing.