RFC: ms bitfields of aligned basetypes

Joern RENNECKE joern.rennecke@st.com
Thu Apr 28 14:35:00 GMT 2005


A testcase to trigger the assert was:

typedef _Bool Tal16bool __attribute__ ((aligned (16)));
struct S49
{
  Tal16bool a:1;
};
 
and it turns out that the underlying problem is actually in the 
general-purpose
field layout code.  Both known_align and actual_align are calculated as
BIGGEST_ALIGNMENT if the offset of the field is zero.  However, the
correct alignment in this case is the alignment of the record, which may be
smaller or larger than BIGGEST_ALIGNMENT, depending on the
alignment of the fields seen so far.



More information about the Gcc mailing list