Hi Devang, > It is possible that I'm not solving the real problem here. > > struct { > char a; > char b; > int c:8; > int d:20; > } S; > > When this struct is packed and S is aligned at 4 byte, what alignment > should be specified on load instruction to load 'd' ?
since the alignment depends the address you choose to load it from, and several strategies are possible, relying on gcc's expr_align seems like a bad move. I think the LValue type should contain alignment info. That way the bitfield lvalue code, which knows exactly how it chose to address the bitfield, can set an appropriate alignment. This also concentrates all nastiness in one spot. [By the way, expr_align contains the following comment: /* LLVM local begin */ /* return correctly the alignment of packed structs */ case COMPONENT_REF: /* LLVM local end */ ] Best wishes, Duncan. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits