rjmccall added a comment.

Good catch!

The better fix would be to ignore the bitfield's abstract storage alignment and 
instead use the base l-value's alignment, adjusted with alignmentAtOffset to 
the offset of the bitfield's storage.  This ensures we get the right alignment 
when the base l-value is *over*-aligned: in a packed struct, bitfield storage 
at offset 0 will have alignment 1, but if the packed struct itself is known to 
have alignment 4 (e.g., if it is embedded in an unpacked struct), then we still 
know that the storage has alignment 4.alignmentAtOffset(0) == 4.

Also, please use CreateAlignedStore and CreateAlignedLoad.


http://reviews.llvm.org/D11034




_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to