]> git.ipfire.org Git - thirdparty/gcc.git/commit
Check HONOR_NANS instead of flag_finite_math_only in frange:verify_range.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 23 Oct 2022 14:51:17 +0000 (16:51 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 24 Oct 2022 10:15:22 +0000 (12:15 +0200)
commit1e9d9ed095df3d064cf9d91d46f3e5426c2a05a7
treed9ae4c7d7c1e67b7e28c89ff871d90bced522018
parent47db37ed477f29ac52c4484c260138d15e44a36b
Check HONOR_NANS instead of flag_finite_math_only in frange:verify_range.

[Jakub and other FP experts, would this be OK, or am I missing
something?]

Vax does not seem to have !flag_finite_math_only, but float_type_node
does not HONOR_NANS.  The check in frange::verify_range dependend on
flag_finite_math_only, which is technically not correct since
frange::set_varying() checks HONOR_NANS instead of
flag_finite_math_only.

I'm actually getting tired of flag_finite_math_only and
!flag_finite_math_only discrepancies in the selftests (Vax and rx-elf
come to mind).  I think we should just test both alternatives in the
selftests as in this patch.

We could also check flag_finite_math_only=0 with a float_type_node
that does not HONOR_NANs, but I have no idea how to twiddle
FLOAT_MODE_FORMAT temporarily, and that may be over thinking it.

PR tree-optimization/107365

gcc/ChangeLog:

* value-range.cc (frange::verify_range): Predicate NAN check in
VARYING range on HONOR_NANS instead of flag_finite_math_only.
(range_tests_floats): Same.
(range_tests_floats_various): New.
(range_tests): Call range_tests_floats_various.
gcc/value-range.cc