On Sat, Aug 9, 2008 at 7:38 PM, Daniel Dunbar <[EMAIL PROTECTED]> wrote:
> Yes, I actually looked at that while implementing the code. I assume
> you meant padded instead of aligned.

Yes... although, alignment is the only way to get implicit padding in structs.

> Is this a case we really care about supporting? It is not immediately clear
> to me that
>   struct __attribute((packed)) x {int a : 24;};
> shouldn't have size sizeof(int) instead of size 3. There is a difference 
> between
> the packing of the bitfield and the size of the structure. Is this a case 
> which
> matters in practice?

Per gcc, it has size 3, so we should honor that.  This bug would only
be exposed by programs very rarely, but that isn't an excuse for
generating wrong code.

Although, I guess it can wait until we add alignment to lvalues;
currently, codegen basically don't handle misaligned fields at all.

-Eli
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to