This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/20794] [4.0/4.1 Regression] Miscompilation with __attribute ((aligned))


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]