This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20794] [4.0/4.1 Regression] Miscompilation with __attribute ((aligned))
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Apr 2005 15:05:26 -0000
- Subject: [Bug middle-end/20794] [4.0/4.1 Regression] Miscompilation with __attribute ((aligned))
- References: <20050406144601.20794.jakub@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jakub at gcc dot gnu dot org 2005-04-06 15:05 -------
Doesn't need to be in struct, and the requested alignment must be bigger
than sizeof (int) to reproduce.
extern void abort (void);
typedef int T __attribute__((aligned (8)));
T a[2];
void *p[2];
int
main (void)
{
p[0] = &a[0];
p[1] = &a[1];
if (p[0] == p[1])
abort ();
return 0;
}
fails as well.
Note that the requested alignment is apparently honored by neither GCC 3.4 and
earlier in C, nor in G++ (3.4 as well as 4.0) for the individual array members,
only the whole array is aligned as if the attribute was present on the array
itself, not on the member type.
So we probably first need to answer whether that layout is correct or if we want
an ABI change here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20794