With set_unknown_p now checking the kind in order to see if the range
reverts to varying, we have to make sure the kind is set before calling
it during value_range construction.
Bootstraps on x86_64-pc-linux-gnu with no regressions. Pushed.
Andrew
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.
---
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 6fb1e801f2b..4a76c91db9b 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 ();
}
--
2.56.0