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: Ulrich Weigand <weigand at immd1 dot informatik dot uni-erlangen dot de>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: weigand at immd1 dot informatik dot uni-erlangen dot de, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org, jason at redhat dot com
- Date: Thu, 10 Apr 2003 22:47:46 +0200 (MET DST)
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
Richard Kenner wrote:
> Well, it looks like DECL_USER_ALIGN is copied from TYPE_USER_ALIGN
> in do_type_align (stor-layout.c), called via this call chain:
>
> I figured it had to be something like that. It's probably correct for C,
> but not for Ada. Perhaps we need a new lang hook?
Hmm, this routine was very recently changed by Jason Merrill:
http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00209.html
I don't quite understand that patch, but it definitely changes
the handling of freshly initialized VAR_DECLs in layout_decl from
! DECL_ALIGN (decl) = TYPE_ALIGN (type);
! DECL_USER_ALIGN (decl) = 0;
to
+ DECL_ALIGN (decl) = TYPE_ALIGN (type);
+ DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type);
This certainly explains why I haven't seen the problem earlier ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
weigand at informatik dot uni-erlangen dot de