https://gcc.gnu.org/g:7374385c962b867eaf226d0e728aa10352a778bf

commit r17-1670-g7374385c962b867eaf226d0e728aa10352a778bf
Author: Andrew MacLeod <[email protected]>
Date:   Thu Jun 18 11:03:05 2026 -0400

    pointsr-to and points-away intersected result is undefined.
    
    when performing an intersection, pointing-to an object and away-from
    an object now results in an UNDEFINED value.
    
            * value-range.cc (prange::intersect): Points-to and away results
            in undefined.

Diff:
---
 gcc/value-range.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 488feb5ca0ff..86eb2f507fb7 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -788,6 +788,13 @@ prange::intersect (const vrange &v)
       return true;
     }
 
+  // If this points to and away, results are undefined,
+  if (pt_inverted_p (r))
+    {
+      set_undefined ();
+      return true;
+    }
+
   prange save = *this;
   m_min = wi::max (r.lower_bound (), lower_bound (), UNSIGNED);
   m_max = wi::min (r.upper_bound (), upper_bound (), UNSIGNED);

Reply via email to