https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95923
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- (With one variant I ended up with (a|b)&(a==b), which we don't optimize to a&b) We don't optimize !(!a && !b) && !(!a && b) && !(a && !b) (we keep several branches), but we do optimize if I manually replace enough && with &.