This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: dje at watson dot ibm dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 10 Apr 03 17:14:59 EDT
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
Yes, the type can have greater alignment. However type normally does
imply a minimum alignment and minimum size. Specifying user alignment
for a well-defined type seems redundant.
You lost me.
If I have a record of two 16-bit fields, the natural alignment of that type
is 16 bits. However, the user is allowed to specify an alignment of 32
bits for the type.
I'm not sure what your second sentence means, but it is indeed true
that the compiler cannot change the alignment of a type since it
bounds it in both directions: it gives the minimum alignment that an
object of that type created by the compiler is guaranteed to have, but
it also gives the *maximum* alignment that the compiler is allowed to assume
that a user-created object of that type will have.