diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-09-01 16:44:29 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-09-01 20:06:19 +0200 |
commit | bb17c5030dc47c69c700e0fd0145285dc8f913a2 (patch) | |
tree | d36060d77ddeaeca09c5c539b313ecdfade64959 /gcc/value-range.cc | |
parent | 5924b6b2e75afa95f09f75ad3ef9ccbeac65d55d (diff) | |
download | gcc-bb17c5030dc47c69c700e0fd0145285dc8f913a2.zip gcc-bb17c5030dc47c69c700e0fd0145285dc8f913a2.tar.gz gcc-bb17c5030dc47c69c700e0fd0145285dc8f913a2.tar.bz2 |
Convert ranger uses of real_inf to dconst[n]inf.
gcc/ChangeLog:
* range-op-float.cc (build_le): Convert to dconst*inf.
(build_ge): Same.
* value-range.cc (frange::set_signbit): Same.
(frange::normalize_kind): Same.
(range_tests_floats): Same.
* value-range.h (vrp_val_max): Same.
(vrp_val_min): Same.
(frange::set_varying): Same.
Diffstat (limited to 'gcc/value-range.cc')
-rw-r--r-- | gcc/value-range.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 71581b2..6fd6e3b 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -320,18 +320,14 @@ frange::set_signbit (fp_prop::kind k) if (k == fp_prop::YES) { // Crop the range to [-INF, 0]. - REAL_VALUE_TYPE min; - real_inf (&min, 1); - frange crop (m_type, min, dconst0); + frange crop (m_type, dconstninf, dconst0); intersect (crop); m_props.set_signbit (fp_prop::YES); } else if (k == fp_prop::NO) { // Crop the range to [0, +INF]. - REAL_VALUE_TYPE max; - real_inf (&max, 0); - frange crop (m_type, dconst0, max); + frange crop (m_type, dconst0, dconstinf); intersect (crop); m_props.set_signbit (fp_prop::NO); } @@ -440,8 +436,8 @@ frange::normalize_kind () if (!m_props.varying_p ()) { m_kind = VR_RANGE; - real_inf (&m_min, 1); - real_inf (&m_max, 0); + m_min = dconstninf; + m_max = dconstinf; return true; } } @@ -3785,12 +3781,9 @@ range_tests_floats () ASSERT_FALSE (r0.varying_p ()); // The endpoints of a VARYING are +-INF. - REAL_VALUE_TYPE inf, ninf; - real_inf (&inf, 0); - real_inf (&ninf, 1); r0.set_varying (float_type_node); - ASSERT_TRUE (real_identical (&r0.lower_bound (), &ninf)); - ASSERT_TRUE (real_identical (&r0.upper_bound (), &inf)); + ASSERT_TRUE (real_identical (&r0.lower_bound (), &dconstninf)); + ASSERT_TRUE (real_identical (&r0.upper_bound (), &dconstinf)); // The maximum representable range for a type is still a subset of VARYING. REAL_VALUE_TYPE q, r; @@ -3800,9 +3793,9 @@ range_tests_floats () // r0 is not a varying, because it does not include -INF/+INF. ASSERT_FALSE (r0.varying_p ()); // The upper bound of r0 must be less than +INF. - ASSERT_TRUE (real_less (&r0.upper_bound (), &inf)); + ASSERT_TRUE (real_less (&r0.upper_bound (), &dconstinf)); // The lower bound of r0 must be greater than -INF. - ASSERT_TRUE (real_less (&ninf, &r0.lower_bound ())); + ASSERT_TRUE (real_less (&dconstninf, &r0.lower_bound ())); // For most architectures, where float and double are different // sizes, having the same endpoints does not necessarily mean the |