linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] division-by-zero warnings
@ 2017-06-03  8:01 Luc Van Oostenryck
  2017-06-03  8:01 ` [PATCH v2 1/8] add is_pseudo_value() Luc Van Oostenryck
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Luc Van Oostenryck @ 2017-06-03  8:01 UTC (permalink / raw)
  To: linux-sparse; +Cc: Chris Li, Luc Van Oostenryck

The goal of this series is to add the 'division by zero'
warnings that are missing. Indeed, sparse only warned about
division by zero when the LHS was a constant. When the LHS
was not a constant (and thus also when the division was part
of a compound assignement) no warning was ever issued.

Note: the floating point division need similar changes
      which will be part of another series.

Changes since v1:
- add the warnins for compound assignments at expansion time too
- code restructuration and simplification
- test cases consolidation


This series is also available in the git repository at:
  git://github.com/lucvoo/sparse.git div-by-zero-v2


Luc Van Oostenryck (8):
  add is_pseudo_value()
  add a .warned field to struct instruction
  div0: warn on integer divide by 0 also when the lhs is not constant
  div0: also check for compound assignments
  div0: add warning option -Wdiv-by-zero
  div0: use -Wdiv-by-zero
  div0: warn also during simplification
  div0: warn on float divide by 0 also when the lhs is not constant

 expand.c                    | 42 +++++++++++++++----------
 lib.c                       |  2 ++
 lib.h                       |  1 +
 linearize.c                 | 17 +++++++++++
 linearize.h                 | 12 ++++++--
 simplify.c                  | 12 ++++++++
 validation/div-by-zero-fp.c | 24 +++++++++++++++
 validation/div-by-zero.c    | 74 +++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 166 insertions(+), 18 deletions(-)
 create mode 100644 validation/div-by-zero-fp.c
 create mode 100644 validation/div-by-zero.c

-- 
2.13.0


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

end of thread, other threads:[~2017-06-05 19:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-03  8:01 [PATCH v2 0/8] division-by-zero warnings Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 1/8] add is_pseudo_value() Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 2/8] add a .warned field to struct instruction Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 3/8] div0: warn on integer divide by 0 also when the lhs is not constant Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 4/8] div0: also check for compound assignments Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 5/8] div0: add warning option -Wdiv-by-zero Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 6/8] div0: use -Wdiv-by-zero Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 7/8] div0: warn also during simplification Luc Van Oostenryck
2017-06-03  8:01 ` [PATCH v2 8/8] div0: warn on float divide by 0 also when the lhs is not constant Luc Van Oostenryck
2017-06-05 19:16 ` [PATCH v2 0/8] division-by-zero warnings Christopher Li

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).