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: Richard Henderson <rth at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 10 Apr 2003 15:06:24 -0700
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- References: <10304102149.AA03328@vlsi1.ultra.nyu.edu>
On Thu, Apr 10, 2003 at 05:49:40PM -0400, Richard Kenner wrote:
> Why? It seems like what it means is "the alignment of this type was set the
> way it is for a reason. Please don't change it." And that applies here.
I'll concede that there's still too much language-specific
widgetry in layout_type, which causes you to want to set
such a flag, but that's as far as I'm willing to go.
Perhaps the short-term solution is as you suggest -- a new
lang hook such that Ada can avoid setting DECL_USER_ALIGN
when the languages allows a larger alignment to be used for
particular objects.
I definitely think the bug is *not* in varasm.c. If I write
"double x __attribute__((aligned(1)))", I expect to see
.comm x,8,1
not
.comm x,8,8
in the assembly file.
I do like Ulrich's change to the s390x backend to cope with
variables explicitly declared with 1 byte alignment.
I definitely think there's a bug in that the Ada front end
sets DECL_USER_ALIGN for these objects and the C front end
(in response to the auto-generated files) does not. That
mis-match should be addressed in some way -- either by not
setting DECL_USER_ALIGN in Ada or by tagging the variables
with attribute aligned in C. I think it's clear that the
former solution would be preferred, since it would result
in better code for this platform. But this is up to yall.
r~