This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/15041] New: different alignments for similar unions
- From: "joerg dot richter at pdv-fs dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Apr 2004 11:23:24 -0000
- Subject: [Bug middle-end/15041] New: different alignments for similar unions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
// main.c
#include <stdio.h>
union union_id
{
int i;
double d;
};
union union_di
{
double d;
int i;
};
int main()
{
printf( "alignof(double)=%d\n", __alignof__(double) );
printf( "alignof(union_id)=%d\n", __alignof__(union union_id) );
printf( "alignof(union_di)=%d\n", __alignof__(union union_di) );
return 0;
}
//////////////
$ gcc -v
Reading specs from /pdv/.tools/pkg/gcc/3.3.3/bin/../lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3.3/specs
Configured with: ../gcc-3.3.3/configure --prefix=/tools/pkg/gcc/3.3.3 --with-
ld=/bin/ld --with-as=/bin/as --enable-languages=c,c++
Thread model: aix
gcc version 3.3.3
$ gcc -o main main.c
$ main
alignof(double)=8
alignof(union_id)=4
alignof(union_di)=8
I think all numbers should be the same.
Verified with:
3.3.3
3.2.1
2.9-aix51-020209
--
Summary: different alignments for similar unions
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joerg dot richter at pdv-fs dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-ibm-aix5.1.0.0
GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15041