https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94793
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- You mean like PR82479 ? Though, __builtin_clz is UB at zero, so it would need to be v >>= 1; r = v ? 32 - __builtin_clz(v) : 0; v = 0; or so, except that on aarch64 (or where we CLZ_DEFINED_VALUE_AT_ZERO as 2, i.e. guarantee if CLZ ifn or builtins to have the behavior defined at GIMPLE rather than say just RTL or never). And on other targets that have CLZ_DEFINED_VALUE_AT_ZERO 1 with value of precision, perhaps convert that conditional into just CLZ at RTL time.