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: rth at redhat dot com, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: 16 Apr 2003 23:38:04 -0300
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- Organization: GCC Team, Red Hat
- References: <10304110200.AA04666@vlsi1.ultra.nyu.edu>
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