[PATCH] [frange] Convert float_binary_op_range_finish to sub-ranges
Aldy Hernandez <[email protected]>
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
Use contains_zero_p to handle sub-ranges.
Tested on ppc64le Linux.
Pushed.
gcc/ChangeLog:
* range-op-float.cc (float_binary_op_range_finish): Use
contains_zero_p on lhs instead of inspecting the hull endpoints.
---
gcc/range-op-float.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 156b4f766db..60c522ee2a0 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -2256,8 +2256,7 @@ float_binary_op_range_finish (bool ret, frange &r, tree type,
{
r.clear_nan ();
if (div_op2
- ? !(real_compare (LE_EXPR, &lhs.lower_bound (), &dconst0)
- && real_compare (GE_EXPR, &lhs.upper_bound (), &dconst0))
+ ? !lhs.contains_zero_p ()
: !(real_isinf (&lhs.lower_bound ())
|| real_isinf (&lhs.upper_bound ())))
// For reverse + or - or * or op1 of /, if result is finite, then
--
2.47.3