This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]