This is the mail archive of the gcc-patches@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 10, 2003, kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner) wrote:

> Instead, it gets set from TYPE_USER_ALIGN, which seems wrong to me
> because it doesn't properly distinguish (in any language) the cases
> where an alignment is specified for a type vs. when its specified
> for a decl.

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?  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.  I mean, if it is not, then, given:

typedef T foo __attribute__((aligned(N));
foo bar;
foo baz __attribute__((aligned(N));

bar and baz might have different alignment requirements, which feels
wrong to me.

-- 
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]