Bug 65833 - gcc does handles __attribute__ ((aligned (n))) differently than other gcc releases
Summary: gcc does handles __attribute__ ((aligned (n))) differently than other gcc rel...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.3
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-06-02 02:42 UTC by Joseph Kain
Modified: 2007-04-18 16:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-06-02 02:42:58 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.