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: Alexandre Oliva <aoliva at redhat dot com>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: 17 Apr 2003 02:37:56 -0300
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- Organization: GCC Team, Red Hat
- References: <10304170403.AA04543@vlsi1.ultra.nyu.edu>
On Apr 17, 2003, kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner) wrote:
> 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.
Well... You can always compare DECL_USER_ALIGN with TYPE_USER_ALIGN,
if you care strongly about that. But the point that whether the
alignment came from a decl-specific attribute or from the type
shouldn't make a difference.
> It might be reasonable for a "consumer" of these bits to do
> DECL_USER_ALIGN (decl) || TYPE_USER_ALIGN (TREE_TYPE (decl))
But why should the common case be more difficult and error-prone? Do
you have any situation in mind in which it is actually important to
tell whether a decl-specific user-requested alignment came from the
variable declaration or from its type?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer