https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108341
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Not always. It depends on the definition of CTZ_DEFINED_VALUE_AT_ZERO. /* The value at zero is only defined for the BMI instructions LZCNT and TZCNT, not the BSR/BSF insns in the original isa. */ #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ ((VALUE) = GET_MODE_BITSIZE (MODE), TARGET_BMI ? 2 : 0) #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ ((VALUE) = GET_MODE_BITSIZE (MODE), TARGET_LZCNT ? 2 : 0) So assuming !=0 with -mbmi would be an invalid assumitation.