https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102245
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, seems the binary context is result of shorten_binary_op, we see the 1L and (((int)x) << 0) operands of BIT_AND_EXPR, result_type is therefore long int and shorten_binary_op uses convert to convert that (((int)x) << 0) to long int and triggers the match.pd rule and folds it into (long int)x (where x has _Bool type). shorten_binary_op then decides to return _Bool type, which is why we have the bool context.