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: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Apr 2005 18:08:47 -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 mark at codesourcery dot com 2005-04-07 18:08 -------
Subject: Re: [4.0/4.1 Regression] Miscompilation with
__attribute ((aligned))
kenner at vlsi1 dot ultra dot nyu dot edu wrote:
> ------- Additional Comments From kenner at vlsi1 dot ultra dot nyu dot edu 2005-04-07 18:03 -------
> Subject: Re: [4.0/4.1 Regression] Miscompilation with __attribute ((aligned))
>
> And the middle end should be able to expect that the size of the
> elements is at least as large as their alignments.
>
> Are you suggesting that this be true just for *array* elements, for all
> elements (including record components), or for all decls?
For array elements. I don't see the same problem with record components
or stand-along objects. The problem comes only in arrays because that
is where pointer-arithmetic is allowed, and then, either:
1. &a[1] != &a[0] + sizeof (a[0]), or
2. &a[1] is not aligned as per the element type
Both of those invariants are inviolate in C, in my opinion.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20794