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 c/46636] attribute aligned is documented as using bytes, uses addressable units instead.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46636

--- Comment #3 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2010-11-24 14:26:52 UTC ---
(In reply to comment #2)
> Well, on these targets "bytes" really are larger I suppose (for example
> each character in a C string constant consumes BITS_PER_UNIT).

A 32 bit wide character is not a byte, it is four bytes.

The documentation states:
 You can also specify the alignment of structure fields.  For example, to
 create a double-word aligned @code{int} pair, you could write:

 @smallexample
 struct foo @{ int x[2] __attribute__ ((aligned (8))); @};
 @end smallexample

If, on a 32-bit word-addressed target, this is aligned to 8 words
instead of two, that would be unexpected.


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