diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-02-12 22:14:27 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-02-12 22:15:40 +0100 |
commit | 3f3932a0ec875cb7cca187018f3f8f05f2519d3e (patch) | |
tree | a87f5f837e40faeb1209cda65f5acce18836fc3d /libssp | |
parent | b32a3f324367ca470aaec1866abe7edf5616bb7c (diff) | |
download | gcc-3f3932a0ec875cb7cca187018f3f8f05f2519d3e.zip gcc-3f3932a0ec875cb7cca187018f3f8f05f2519d3e.tar.gz gcc-3f3932a0ec875cb7cca187018f3f8f05f2519d3e.tar.bz2 |
real: Fix roundeven on inf/nan [PR93663]
As can be seen in the testcase, roundeven with inf or nan arguments
ICE because of those asserts where nothing prevents from is_halfway_below
being called with those arguments.
The following patch fixes that by just returning false for rvc_inf/rvc_nan
like it returns for rvc_zero, so that we handle roundeven with all those
values as round. Inf/NaN are not halfway in between two integers...
2020-02-12 Jakub Jelinek <jakub@redhat.com>
PR middle-end/93663
* real.c (is_even): Make static. Function comment fix.
(is_halfway_below): Make static, don't assert R is not inf/nan,
instead return false for those. Small formatting fixes.
* gcc.dg/torture/builtin-round-roundeven.c (main): Add tests
for DBL_MAX, inf, their negations and nan.
Diffstat (limited to 'libssp')
0 files changed, 0 insertions, 0 deletions