This is the mail archive of the
gcc-patches@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 19:40:19 -0300
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- Organization: GCC Team, Red Hat
- References: <10304172034.AA10360@vlsi1.ultra.nyu.edu>
On Apr 17, 2003, kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner) wrote:
> But you don't mind if stand-alone objects of that type were aligned
> stricter. If you specifically set the alignment of an object, you
> are presumably doing so because you *don't* want the object to be
> put at a stricter alignment.
Thanks, I do see your point now. However, I still don't think the
compiler should disregard alignment requirements set to the type just
because an object is not part of a record. I do agree that the
compiler may do it, and it may even happen by chance, but the property
of the type should carry over to objects and fields uniformly, in the
absence of an overrider. The same point you make for someone setting
the alignment for an object to something different than the type's
alignment could be made for someone setting the alignment for say a
typedef, expecting it to affect all uses of the typedef.
Distinguishing between type-specified and decl-specified alignments
defeats this purpose.
--
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