https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114203
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:cde50296a19b109909089b91d532d2c8455f5f10 commit r14-9293-gcde50296a19b109909089b91d532d2c8455f5f10 Author: Richard Biener <rguent...@suse.de> Date: Mon Mar 4 10:38:31 2024 +0100 tree-optimization/114203 - wrong CLZ niter computation For precision less than int we apply the adjustment to make it defined at zero after the adjustment to make it compute CLZ rather than CTZ. That's wrong. PR tree-optimization/114203 * tree-ssa-loop-niter.cc (build_cltz_expr): Apply CTZ->CLZ adjustment before making the result defined at zero. * gcc.dg/torture/pr114203.c: New testcase.