As discussed in the PR, flushing denormals to zero on every frange::set
might be harmful for e.g. x < 0.0 comparisons, because we then on both
sides use ranges that include zero [-Inf, -0.0] on the true side, and
[-0.0, +Inf] NAN on the false side, rather than [-Inf, nextafter (-0.0, -Inf)]
on the true side.
The following patch does it only in range_operator_float::fold_range
which is right now used for +-*/ (both normal and reverse ops of those).
Though, I don't see any difference on the testcase in the PR, but not sure
what I should be looking at and the reduced testcase there has undefined
behavior.
2023-03-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/109154
* value-range.h (frange::flush_denormals_to_zero): Make it public
rather than private.
* value-range.cc (frange::set): Don't call flush_denormals_to_zero
here.
* range-op-float.cc (range_operator_float::fold_range): Call
flush_denormals_to_zero.
}
}
+ r.flush_denormals_to_zero ();
+
return true;
}
normalize_kind ();
- flush_denormals_to_zero ();
-
if (flag_checking)
verify_range ();
}
void update_nan (tree) = delete; // Disallow silent conversion to bool.
void update_nan (const nan_state &);
void clear_nan ();
+ void flush_denormals_to_zero ();
// fpclassify like API
bool known_isfinite () const;
bool union_nans (const frange &);
bool intersect_nans (const frange &);
bool combine_zeros (const frange &, bool union_p);
- void flush_denormals_to_zero ();
tree m_type;
REAL_VALUE_TYPE m_min;