https://gcc.gnu.org/g:0e57e1c072d5e3e5af15e7de182111be5c2cf5e6
commit r17-1669-g0e57e1c072d5e3e5af15e7de182111be5c2cf5e6 Author: Andrew MacLeod <[email protected]> Date: Thu Jun 18 10:58:57 2026 -0400 invariant_p should return true or false instead of a tree left from a previous API version, the boolean result should be true or false, not a TREE which is then converted to a boolean. * value-range.h (prange::pt_invariant_p): Return true or false. (prange::pt_invariant_away_p): Likewise. Diff: --- gcc/value-range.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index abed19d9209e..d5588faefb41 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -461,12 +461,16 @@ public: tree pt_invariant () const; tree pt_invariant_away () const; - // Return true if present and identical for THIS and R. + // Return true if THIS and R both point to the same object. bool pt_invariant_p (const prange &r) const; + // Return true if THIS and R both point away from the same object. bool pt_invariant_away_p (const prange &r) const; + // Return true if THIS and R refer to the same object, and one is inverted + // from the other, Ie, both to and away. + bool pt_inverted_p (const prange &r) const; + // Invert THIS if it points either to or away from an object. bool pt_invert (); - bool pt_inverted_p (const prange &r) const; // pt_base () - object/allocation the pointer refers into. tree pt_base () const; @@ -1555,8 +1559,8 @@ prange::pt_invariant_p (const prange &r) const { if (m_pt && m_points_to_p && vrp_operand_equal_p (r.m_pt, m_pt) && m_points_to_p == r.m_points_to_p) - return m_pt; - return NULL_TREE; + return true; + return false; } inline bool @@ -1564,8 +1568,8 @@ prange::pt_invariant_away_p (const prange &r) const { if (m_pt && !m_points_to_p && vrp_operand_equal_p (r.m_pt, m_pt) && m_points_to_p == r.m_points_to_p) - return m_pt; - return NULL_TREE; + return true; + return false; }
