This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: ms bitfields of aligned basetypes
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: Danny Smith <dannysmith at clear dot net dot nz>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 28 Apr 2005 15:12:53 +0100
- Subject: Re: RFC: ms bitfields of aligned basetypes
- References: <001101c54914$69092df0$496d65da@anykey>
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.