https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The pattern should be: (simplify (bit_and:c (convert@2 (eq @0 INTEGER_CST@1)) (convert? @0)) (if ((wi::to_wide (@1) & 1) != 0) @2 { build_zero_cst (type); })) Since 0/1 of the eq, the convert on the @0 inside the bit_and does not matter.