The following patch adds sqrt support (but similarly to sincos, only
dumb basic ranges only).
Will improve this incrementally and sin/cos as well.
2023-04-28 Jakub Jelinek <jakub@redhat.com>
* gimple-range-op.cc (class cfn_sqrt): New type.
(op_cfn_sqrt): New variable.
(gimple_range_op_handler::maybe_builtin_call): Handle
CASE_CFN_SQRT{,_FN}.
* gcc.dg/tree-ssa/range-sqrt.c: New test.
* gfortran.dg/ieee/ieee_6.f90: Make x volatile to avoid
ranger optimizing sqrt (-1) call away because it is only used in
test for whether it returns NaN.