https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122212
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:5ab4db545906270de5dc2a21447392ac3332cf2b commit r16-4319-g5ab4db545906270de5dc2a21447392ac3332cf2b Author: Richard Biener <[email protected]> Date: Thu Oct 9 09:06:27 2025 +0200 tree-optimization/122212 - fix CLZ detection The following corrects a mistake with the zero value handling which was broken because the bits bias was applied first which works for the special-case using a bit-and but not when using a conditional move. Apply this after the fact instead where it also more easily folds with an existing bias we compensate. PR tree-optimization/122212 * tree-ssa-forwprop.cc (simplify_count_zeroes): Apply bias for CLZ after dealing with the zero special value. * gcc.dg/torture/pr122212.c: New testcase.
