https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95929
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- On the GCC 13+ we get: _1 = a_5(D) != 0; _8 = a_5(D) == 0; // _1^1 _2 = b_3(D) != 0; _13 = _2 ? _8 : _1; _6 = (int) _13; or rather _13 = _2 ? _1 ^ 1 : _1 But we don't match that. We could dosoemthing like: ``` (for cmp (for cmpN (simplify (cond @0 (cmpN @1 @2) (cmp@3 @1 @2)) (if (inverseof(cmp, TREE_TYPE (@1)) == cmpN) (bit_xor (convert @0) @3) ) ) ) ) ``` And that would fix this I think.