From aab162fb24bc03d8720da802ba08e3ab391627c0 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Fri, 9 Nov 2018 09:53:11 +0000 Subject: [PATCH] tree-vrp.c (value_range::check): Do not access internals directly. * tree-vrp.c (value_range::check): Do not access internals directly. (value_range::singleton_p): Same. (value_range::type): Same. (vrp_finalize): Use value_range API. From-SVN: r265955 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-vrp.c | 16 +++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d4ab1bba0f..9df874d646b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-11-08 Aldy Hernandez + + * tree-vrp.c (value_range::check): Do not access internals + directly. + (value_range::singleton_p): Same. + (value_range::type): Same. + (vrp_finalize): Use value_range API. + 2018-11-08 Aldy Hernandez * tree-vrp.c (may_contain_p): Do not access m_min/m_max directly. diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 6df749c56dd..73b9e047389 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -157,7 +157,7 @@ value_range::check () } case VR_UNDEFINED: case VR_VARYING: - gcc_assert (!m_min && !m_max); + gcc_assert (!min () && !max ()); gcc_assert (!m_equiv || bitmap_empty_p (m_equiv)); break; default: @@ -291,11 +291,11 @@ bool value_range::singleton_p (tree *result) const { if (m_kind == VR_RANGE - && vrp_operand_equal_p (m_min, m_max) - && is_gimple_min_invariant (m_min)) + && vrp_operand_equal_p (min (), max ()) + && is_gimple_min_invariant (min ())) { if (result) - *result = m_min; + *result = min (); return true; } return false; @@ -306,8 +306,8 @@ value_range::type () const { /* Types are only valid for VR_RANGE and VR_ANTI_RANGE, which are known to have non-zero min/max. */ - gcc_assert (m_min); - return TREE_TYPE (m_min); + gcc_assert (min ()); + return TREE_TYPE (min ()); } /* Dump value range to FILE. */ @@ -6558,9 +6558,7 @@ vrp_prop::vrp_finalize (bool warn_array_bounds_p) && range_includes_zero_p (vr) == 0) set_ptr_nonnull (name); else if (!POINTER_TYPE_P (TREE_TYPE (name))) - set_range_info (name, vr->kind (), - wi::to_wide (vr->min ()), - wi::to_wide (vr->max ())); + set_range_info (name, *vr); } /* If we're checking array refs, we want to merge information on -- 2.30.2