DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT

Ulrich Weigand weigand@immd1.informatik.uni-erlangen.de
Thu Apr 10 21:01:00 GMT 2003


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@informatik.uni-erlangen.de



More information about the Gcc mailing list