Bug 65833 - gcc does handles __attribute__ ((aligned (n))) differently than other gcc releases
gcc does handles __attribute__ ((aligned (n))) differently than other gcc rel...
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.3
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-06-01 22:42 EDT by Joseph Kain
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-06-01 22:42:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joseph Kain 2002-06-01 22:42:53 EDT
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 05:16:59 EDT
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.