DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT

Alexandre Oliva aoliva@redhat.com
Thu Apr 17 05:39:00 GMT 2003


On Apr 10, 2003, kenner@vlsi1.ultra.nyu.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@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Gcc mailing list