[PATCH v4 0/9] fix loading of partially defined bitfield

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 avoid internal infinite loops occuring when
processing undefined vars present during the SSA construction.


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.

Change since v3:
- add timeout support in the testsuite
- add a testcase for infinite loop
- improve some commit messages

----------------------------------------------------------------

The series is also available in the git repository at:

  git://github.com/lucvoo/sparse.git fix-loading-partialy-defined-bitfields-v4


Luc Van Oostenryck (9):
      testsuite: add support for commands with timeout
      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

 Documentation/test-suite               |   4 ++
 flow.c                                 |  39 +-----------
 linearize.c                            |  15 +++--
 linearize.h                            |   5 ++
 simplify.c                             | 109 ++++++++++++++++++++++++++++++---
 unssa.c                                |   5 --
 validation/bitfield-size.c             |   4 +-
 validation/infinite-loop0.c            |  11 ++++
 validation/optim/store-load-bitfield.c |  66 ++++++++++++++++++++
 validation/test-suite                  |   7 +++
 10 files changed, 205 insertions(+), 60 deletions(-)
 create mode 100644 validation/infinite-loop0.c
 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



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux