https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126827
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrea Pinski <[email protected]>: https://gcc.gnu.org/g:53799b81fad8cdb37d0df0f79a489fd7aa3c217d commit r17-3553-g53799b81fad8cdb37d0df0f79a489fd7aa3c217d Author: Andrea Pinski <[email protected]> Date: Sat Aug 15 23:16:03 2026 -0700 range: Add some non-negative function support [PR126827] This adds some simple non-negative support for some builtins that return a real type. There are 3 categories of functions: * non-negative independent of arguments * non-negative dependent on the first argument * non-negative dependent on the first argument and sets the nan-ness based on if the first argument contains a nan. This is the first step in removing gimple_stmt_nonnegative_p or rather moving it just use the current ranger rather than doing a recusive walk. I have not added the functions which return an integer and a double value yet. This will be done in a seperate patch. For sinhatanh-3.c I had turn off jump threading otherwise there are more copies of atanhl on x86_64 due to ATANHL being an optab and cdce would create some conditions that could be jump threaded now. This is ok since what this is testing to make sure the pattern added r9-4480-g4aff6d17446ade in does not happen. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/126827 gcc/ChangeLog: * gimple-range-op.cc (class cfn_fp_nonnegative): New class. (class cfn_fp_nonnegative_arg0): New class. (gimple_range_op_handler::maybe_builtin_call): Handle some functions which were handled in nonnegative. gcc/testsuite/ChangeLog: * gcc.dg/sinhatanh-3.c: Turn off jump threading. * gcc.dg/tree-ssa/ceil-1.c: New test. Signed-off-by: Andrea Pinski <[email protected]>
