The goal of this series is to fix the problem present in sparse when a bitfield in an uninitialized automatic variable is first set then read-back. In this case the bitfield itself is initialized but not the remaining of the structure/word and sparse was not smart enough to handle it. This is for testing only as it still requires some verifications. Dibyendu, This should now really solve your test case with: s3.onebit = 1; if (s3.onebit != 1) ... Changes since v1: - use the hack from March to work-around the problem with undefined vars. - add the missing simplifications to make the store-and-load-back of a bitfield almost a no-op as it should be. The series is available in the git repository at: git://github.com/lucvoo/sparse.git fix-loading-partialy-defined-bitfields-v2 ---------------------------------------------------------------- Luc Van Oostenryck (8): Remove single-store shortcut new helper: def_opcode() reuse nbr_pseudo_users() change the masking when loading bitfields simplify ((A & M') | B ) & M when M' & M == 0 transform (A & M) >> S to (A >> S) & (M >> S) transform (A << S) >> S into A & (-1 >> S) fix: cast of OP_AND only valid if it's an OP_CAST flow.c | 39 +----------- linearize.c | 15 +++-- linearize.h | 5 ++ simplify.c | 107 ++++++++++++++++++++++++++++++--- unssa.c | 5 -- validation/bitfield-size.c | 4 +- validation/optim/store-load-bitfield.c | 66 ++++++++++++++++++++ 7 files changed, 181 insertions(+), 60 deletions(-) create mode 100644 validation/optim/store-load-bitfield.c -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html