https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93504
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=110111 Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So it is this pattern: ``` /* (x & ~m) | (y & m) -> ((x ^ y) & m) ^ x */ (simplify (bit_ior:c (bit_and:cs @0 (bit_not @2)) (bit_and:cs @1 @2)) (bit_xor (bit_and (bit_xor @0 @1) @2) @0)) ``` If we change it to: ``` /* (x & ~m) | (y & m) -> ((x ^ y) & m) ^ x */ (simplify (bit_ior:c (bit_and:cs @0 (maybe_bit_not @3)) (bit_and:cs @1 @2)) (with { bool wascmp; } (if (bitwise_inverted_equal_p (@1, @3, wascmp) (bit_xor (bit_and (bit_xor @0 @1) @2) @0)))) ``` This should fix it.