[cfe-dev] Incorrect alignment when accessing a bitfield member of an unaligned struct

Eli Friedman eli.friedman at gmail.com
Wed Jun 27 14:22:29 PDT 2012


On Wed, Jun 27, 2012 at 11:45 AM, Steven Watanabe <watanabesj at gmail.com> wrote:
> AMDG
>
> Compiling the attached source with
> clang -cc1 -emit-llvm test.c
> generates incorrect code.
>
> Note that the load is marked align 4,
> even though it's actually unaligned.
>
> The problem is that CodeGenFunction::EmitLValueForField
> discards the alignment of base when calling
> EmitLValueForBitfield.

r159295.

-Eli



More information about the cfe-dev mailing list