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 00:03:41 EDT
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
What I don't get is why such cases must be distinguished. I mean, if
an alignment is specified by the user for a type, is it not true that
the user is also specifying the alignment for any objects of that
type, except when overridden for a specific object?
Perhaps, but the point is that if you set DECL_USER_ALIGN from
TYPE_USER_ALIGN you *can't tell* if it was "overridden for a specific
object" or not and that information is useful.
It seems to me that this is the point of the change that propagates
TYPE_USER_ALIGN to DECL_USER_ALIGN, and I can't see how this could
possibly be incorrect.
It might be reasonable for a "consumer" of these bits to do
DECL_USER_ALIGN (decl) || TYPE_USER_ALIGN (TREE_TYPE (decl))
if it wanted that interpretation, but I think all four cases are
potentially different and the flags should be set up to be able to
distinguish them.