[PATCH 0/4] Replace nonzero_p with contains_zero_p

Aldy Hernandez <[email protected]> Wed, 5 Aug 2026 16:17:19 +0200
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
Per our discussion, nonzero_p() has always been a bit insane.  It only
returns true for ~[0,0] so even [13,13] is considered false.
Introduce contains_zero_p(), which from the looks of it, we've already
been hand crafting, as direct nonzero_p() calls were few.

How does this look?

Aldy


*** BLURB HERE ***

Aldy Hernandez (4):
  Add contains_zero_p to the vrange hierarchy.
  Use !contains_zero_p for known nonzero tests instead of nonzero_p.
  Implement the exact nonzero-set test without nonzero_p.
  Remove nonzero_p.

 gcc/analyzer/region-model.cc |  2 +-
 gcc/gimple-range-path.cc     |  2 +-
 gcc/range-op.cc              |  2 +-
 gcc/tree-ssa-structalias.cc  |  2 +-
 gcc/tree-ssanames.cc         |  2 +-
 gcc/tree-vrp.cc              |  2 +-
 gcc/value-range-storage.cc   | 21 +++++++++++++--
 gcc/value-range.cc           | 51 +++++++++++++-----------------------
 gcc/value-range.h            | 24 ++++++++++-------
 9 files changed, 57 insertions(+), 51 deletions(-)

-- 
2.47.3