]> gcc.gnu.org Git - gcc.git/commit
cdce: Fix up get_no_error_domain for new f{16,32,64,128} builtins [PR107547]
authorJakub Jelinek <jakub@redhat.com>
Tue, 8 Nov 2022 12:24:02 +0000 (13:24 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 8 Nov 2022 12:24:02 +0000 (13:24 +0100)
commit970dcd567449ec510477a043bbff70a0b960bd7f
tree0390f4d18ba4eda430651c23c9546fe7ad6620f8
parentfa271afb58423014e2feef9f15c1a87428e64ddc
cdce: Fix up get_no_error_domain for new f{16,32,64,128} builtins [PR107547]

I've missed that this function needs to handle all the builtins that
are handled in can_test_argument_range.
The following patch does that.  For many of the builtins (like acos, or
log) it is the same range regardless of the floating point type, but for
some (cosh, sinh, exp{,m1,2}) it is different for each format,
so I had to compute those ranges.

Note, seems the existing ranges were in some cases (e.g. for exp2)
the smallest in absolute value which results infinite result, in others
the largest which still results in finite result (but consistently so
for the IEEE single vs. double).  I've followed that for IEEE half and
quad cases too, just am not sure why it was like that.  I think
get_domain with true, false is open interval rather than closed
and the comments indicate that too, conservatively that is certainly
correct.

OT, with frange, perhaps we could DCE the calls unconditionally if
frange can prove we are in the domain range.

2022-11-08  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/107547
* tree-call-cdce.cc (get_no_error_domain): Handle CASE_FLT_FN_FLOATN_NX
of BUILT_IN_{ACOS,ASIN,ACOSH,ATANH,LOG,LOG2,LOG10,LOG1P}.  Handle
BUILT_IN_{COSH,SINH,EXP,EXPM1,EXP2}F{16,32,64,128}.

* gcc.dg/pr107547.c: New test.
gcc/testsuite/gcc.dg/pr107547.c [new file with mode: 0644]
gcc/tree-call-cdce.cc
This page took 0.070184 seconds and 5 git commands to generate.