aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/f95-lang.cc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2022-09-14 06:58:35 +0200
committerAldy Hernandez <aldyh@redhat.com>2022-09-14 17:06:48 +0200
commit9c4c4186eb7ca0a62fc590edcbb3f8fc9a081e64 (patch)
tree2e83a9a76cc97b9f29f58787da442680e094a660 /gcc/fortran/f95-lang.cc
parent6da65479fcd86c21d0f6b731dda763b574e8066c (diff)
downloadgcc-9c4c4186eb7ca0a62fc590edcbb3f8fc9a081e64.zip
gcc-9c4c4186eb7ca0a62fc590edcbb3f8fc9a081e64.tar.gz
gcc-9c4c4186eb7ca0a62fc590edcbb3f8fc9a081e64.tar.bz2
Provide cleaner set_nan(), clear_nan(), and update_nan() methods.
set_* has a very specific meaning for irange's and friends. Methods prefixed with set_* are setters clobbering the existing range. As such, the current set_nan() method is confusing in that it's not actually setting a range to a NAN, but twiddling the NAN flags for an existing frange. This patch replaces set_nan() with an update_nan() to set the flag, and clear_nan() to clear it. This makes the code clearer, and though the confusing tristate is still there, it will be removed in upcoming patches. Also, there is now an actual set_nan() method to set the range to a NAN. This replaces two out of class functions doing the same thing. In future patches I will also add the ability to create a NAN with a specific sign, but doing so now would be confusing because we're not tracking NAN signs. We should also submit set_signbit to the same fate, but it's about to get removed. No functional changes. Regstrapped on x86-64 Linux, plus I ran selftests for -ffinite-math-only. gcc/ChangeLog: * range-op-float.cc (frange_set_nan): Remove. (build_lt): Use set_nan, update_nan, clear_nan. (build_gt): Same. (foperator_equal::op1_range): Same. (foperator_not_equal::op1_range): Same. (foperator_lt::op1_range): Same. (foperator_lt::op2_range): Same. (foperator_le::op1_range): Same. (foperator_le::op2_range): Same. (foperator_gt::op1_range): Same. (foperator_gt::op2_range): Same. (foperator_ge::op1_range): Same. (foperator_ge::op2_range): Same. (foperator_unordered::op1_range): Same. (foperator_ordered::op1_range): Same. * value-query.cc (range_query::get_tree_range): Same. * value-range.cc (frange::set_nan): Same. (frange::update_nan): Same. (frange::union_): Same. (frange::intersect): Same. (range_tests_nan): Same. (range_tests_signed_zeros): Same. (range_tests_signbit): Same. (range_tests_floats): Same. * value-range.h (class frange): Add update_nan and clear_nan. (frange::set_nan): New.
Diffstat (limited to 'gcc/fortran/f95-lang.cc')
0 files changed, 0 insertions, 0 deletions