https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115337
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:181861b072ff1ef650c1a9d0290a4a672b9e747c commit r15-1013-g181861b072ff1ef650c1a9d0290a4a672b9e747c Author: Jakub Jelinek <ja...@redhat.com> Date: Tue Jun 4 15:52:09 2024 +0200 fold-const: Handle CTZ like CLZ in tree_call_nonnegative_warnv_p [PR115337] I think we can handle CTZ exactly like CLZ in tree_call_nonnegative_warnv_p. Like CLZ, if it is UB at zero, the result range is [0, prec-1] and if it is well defined at zero, the second argument provides the value at zero. 2024-06-04 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/115337 * fold-const.cc (tree_call_nonnegative_warnv_p): Handle CASE_CFN_CTZ like CASE_CFN_CLZ.