diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-11-16 07:30:07 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-11-16 07:30:07 +0100 |
commit | 7c6cd9c05efca29a1a9635b81c86cbad25bbdbbe (patch) | |
tree | 241f98b0b5db21c5780b4e35952506f52dab6186 /gcc/cp | |
parent | 2b7f0378b915a6a294b330bea00e50069f181bd7 (diff) | |
download | gcc-7c6cd9c05efca29a1a9635b81c86cbad25bbdbbe.zip gcc-7c6cd9c05efca29a1a9635b81c86cbad25bbdbbe.tar.gz gcc-7c6cd9c05efca29a1a9635b81c86cbad25bbdbbe.tar.bz2 |
ragen-op-float: Fix up float_binary_op_range_finish [PR107668]
The following testcase ICEs, because when !HONOR_NANS but
HONOR_SIGNED_ZEROS, if we see
lhs = op1 * op2;
and know that lhs is [-0.0, 0.0] and op2 is [0.0, 0.0], the
division of these two yields UNDEFINED and clear_nan () on it
fails an assert. With HONOR_NANS it would actually result in
a known NAN, but when NANs aren't honored, we clear the NAN bits.
Now, for the above case we actually don't know anything about
the op1 range (except that it isn't a NAN/INF because of
!HONOR_NANS !HONOR_INFINITIES), so I think the best is just
to return VARYING for the case we get UNDEFINED as well.
If we want, the op[12]_range methods perhaps can handle the
corner cases earlier separately, say for
lhs [0.0, 0.0] and op2 [0.0, 0.0] when HONOR_SIGNED_ZEROS this
would be just [0.0, MAX].
2022-11-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/107668
* range-op-float.cc (float_binary_op_range_finish): Set VARYING
also when r is UNDEFINED.
* gcc.dg/ubsan/pr107668.c: New test.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions