https://gcc.gnu.org/g:63b3a8221ec633cab54cd820ac890477819ac186

commit r17-5674-g63b3a8221ec633cab54cd820ac890477819ac186
Author: Andrew MacLeod <[email protected]>
Date:   Mon Oct 26 19:06:53 2026 -0400

    Do not call pt_set_unknown until m_kind is set.
    
    Make sure all the other fields are set before making this call.
    
            PR tree-optimization/128177
            * value-range.cc (prange::set): Call set_unknown_pt last during
            range construction.

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

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 6fb1e801f2be..4a76c91db9b6 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -673,12 +673,12 @@ prange::set (tree type, const wide_int &min, const 
wide_int &max,
   m_type = type;
   m_min = min;
   m_max = max;
-  set_pt_unknown ();
 
   if (m_min == 0 && m_max == -1)
     {
       m_kind = VR_VARYING;
       m_bitmask.set_unknown (TYPE_PRECISION (type));
+      set_pt_unknown ();
       if (flag_checking)
        verify_range ();
       return;
@@ -686,6 +686,7 @@ prange::set (tree type, const wide_int &min, const wide_int 
&max,
 
   m_kind = VR_RANGE;
   m_bitmask = irange_bitmask (type, min, max);
+  set_pt_unknown ();
   if (flag_checking)
     verify_range ();
 }

Reply via email to