https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101339
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- And int f(int a, int b) { _Bool c = a == b; int t = c; int t1 = t + 1; return t1 & 1; } is not optimized to return (int)a != b either (for any odd add). Addition of even adds is handled though.