------- Additional Comments From kenner at vlsi1 dot ultra dot nyu dot edu
2005-04-07 14:41 -------
Subject: Re: [4.0/4.1 Regression] Miscompilation with __attribute ((aligned))
With user defined alignment, size certainly is not necessarily a
multiple of the alignment and with the exception of arrays it
shouldn't cause any problems.
Well, I always thought that was invalid. Indeed for Ada, I make a new
type with the larger size. We've never actually *documented* anywhere
that the size is a multiple of the alignment, but I think lots of stuff
all over the place silently assumes it.
In arrays I agree this is a problem. Now, the question is what to do:
1) issue error whenever a type with alignment bigger than size is used in
an array
2) align the whole array and change the element type silently to a type
with alignment equal to the element size
I think (2) is best.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20794