https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111972
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- These should work: (simplify (convert (eq one_zero_valued_p@1 one_zero_valued_p@2)) (if (types_match (type, TREE_TYPE (@1))) (bit_xor @1 (bit_xor! @2 { build_one_cst (type); })))) (simplify (convert (ne one_zero_valued_p@1 one_zero_valued_p@2)) (if (types_match (type, TREE_TYPE (@1))) (bit_xor @1 @2}))) Will test tomorrow.