The goal of this series is to fix the problems 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. It will also solve most infinite loops that can happen when processing undefined vars. 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. Change since v2: - in patch 7, '-1' really meant 'all ones' but only for the size of the word, not bigger. Thanks to Linus for noticing it. - add a note in patch 1 about the infinite loops. The series is also available in the git repository at: git://github.com/lucvoo/sparse.git fix-loading-partialy-defined-bitfields-v3 ---------------------------------------------------------------- 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 | 109 ++++++++++++++++++++++++++++++--- unssa.c | 5 -- validation/bitfield-size.c | 4 +- validation/optim/store-load-bitfield.c | 66 ++++++++++++++++++++ 7 files changed, 183 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