aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op-float.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-03-28 11:00:32 +0200
committerJakub Jelinek <jakub@redhat.com>2023-03-28 11:00:32 +0200
commitce3974e5962b0e1f72a1f71ebda39d53a77b7cc9 (patch)
tree5cdedd975249b8b02713510b7b83a40b07e8bdee /gcc/range-op-float.cc
parent39a43dc336561e0eba0de477b16c7355f19d84ee (diff)
downloadgcc-ce3974e5962b0e1f72a1f71ebda39d53a77b7cc9.zip
gcc-ce3974e5962b0e1f72a1f71ebda39d53a77b7cc9.tar.gz
gcc-ce3974e5962b0e1f72a1f71ebda39d53a77b7cc9.tar.bz2
range-op-float: Only flush_denormals_to_zero for +-*/ [PR109154]
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.
Diffstat (limited to 'gcc/range-op-float.cc')
-rw-r--r--gcc/range-op-float.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index dc9789b..d212e64 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -112,6 +112,8 @@ range_operator_float::fold_range (frange &r, tree type,
}
}
+ r.flush_denormals_to_zero ();
+
return true;
}