This is the mail archive of the gcc@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]

Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT


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


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