checking pt_unknown_p() should not be needed, having a NULL condition
should have no points to field set. Assert this is true.
Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed.
Andrew
From fca6f142a9a12815038a661922c829a5fb2f2a47 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <[email protected]>
Date: Thu, 18 Jun 2026 10:45:39 -0400
Subject: [PATCH 1/3] Do not check points-to in zero_p.
checking pt_unknown_p() should not be needed, having a NULL condition
should have no points to field set. Assert this is true.
* value-range.h (prange::zero_p): Assert that is zero_p is true,
points_to is unknown.
---
gcc/value-range.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 0ab67303009..abed19d9209 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -1424,7 +1424,10 @@ prange::contains_p (tree cst) const
inline bool
prange::zero_p () const
{
- return m_kind == VR_RANGE && m_min == 0 && m_max == 0 && pt_unknown_p ();
+ bool ret = m_kind == VR_RANGE && m_min == 0 && m_max == 0;
+ // if zero_p is true, there should be no points to info.
+ gcc_checking_assert (!ret || pt_unknown_p ());
+ return ret;
}
inline bool
--
2.45.0