linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] fix loading of partially defined bitfield
@ 2017-08-08 23:06 Luc Van Oostenryck
  2017-08-08 23:06 ` [PATCH v3 1/8] Remove single-store shortcut Luc Van Oostenryck
                   ` (8 more replies)
  0 siblings, 9 replies; 32+ messages in thread
From: Luc Van Oostenryck @ 2017-08-08 23:06 UTC (permalink / raw)
  To: linux-sparse
  Cc: Christopher Li, Linus Torvalds, Dibyendu Majumdar,
	Luc Van Oostenryck

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2017-08-12 20:14 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08 23:06 [PATCH v3 0/8] fix loading of partially defined bitfield Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 1/8] Remove single-store shortcut Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 2/8] new helper: def_opcode() Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 3/8] reuse nbr_pseudo_users() Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 4/8] change the masking when loading bitfields Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 5/8] simplify ((A & M') | B ) & M when M' & M == 0 Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 6/8] transform (A & M) >> S to (A >> S) & (M >> S) Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 7/8] transform (A << S) >> S into A & (-1 " Luc Van Oostenryck
2017-08-08 23:06 ` [PATCH v3 8/8] fix: cast of OP_AND only valid if it's an OP_CAST Luc Van Oostenryck
2017-08-09  5:52 ` [PATCH v3 0/8] fix loading of partially defined bitfield Christopher Li
2017-08-09 19:37   ` [PATCH v4 0/9] " Luc Van Oostenryck
2017-08-09 19:37     ` [PATCH v4 1/9] testsuite: add support for commands with timeout Luc Van Oostenryck
2017-08-09 19:37     ` [PATCH v4 2/9] Remove single-store shortcut Luc Van Oostenryck
2017-08-09 19:47       ` Dibyendu Majumdar
2017-08-09 20:02         ` Luc Van Oostenryck
2017-08-09 22:23           ` Dibyendu Majumdar
2017-08-09 23:15             ` Luc Van Oostenryck
2017-08-09 23:32               ` Dibyendu Majumdar
2017-08-09 23:51                 ` Luc Van Oostenryck
2017-08-12 18:51                   ` Dibyendu Majumdar
2017-08-12 19:28                     ` Luc Van Oostenryck
2017-08-12 19:55                       ` Dibyendu Majumdar
2017-08-12 20:14                         ` Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 3/9] new helper: def_opcode() Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 4/9] reuse nbr_pseudo_users() Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 5/9] change the masking when loading bitfields Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 6/9] simplify ((A & M') | B ) & M when M' & M == 0 Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 7/9] transform (A & M) >> S to (A >> S) & (M >> S) Luc Van Oostenryck
2017-08-10  1:16       ` Christopher Li
2017-08-10 23:41         ` Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 8/9] transform (A << S) >> S into A & (-1 " Luc Van Oostenryck
2017-08-09 19:38     ` [PATCH v4 9/9] fix: cast of OP_AND only valid if it's an OP_CAST Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).