This is the mail archive of the
gcc@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: aoliva at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 17 Apr 03 16:29:29 EDT
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
I hope not if this would change the layout of a structure containing a
member with the specified alignment requirement. This is where
propagating the user-requested alignment for a type into the field
decl comes into play: by doing this, we make sure the alignment
request is obeyed, regardless of whether it comes from the field decl
or from its type.
Yes, but this is precisely the case you have been asking to see: if you
set the alignment of a type, you do *not* want a field of the type to
be stricter aligned, but you don't care about an object. You *do* care
about the object if you *also* specify an alignment for it, which is why
you must distinguish between the two cases.