DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
Richard Henderson
rth@redhat.com
Thu Apr 10 22:08:00 GMT 2003
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~
More information about the Gcc-patches
mailing list