On 12/31/23 21:03, Andrew Pinski wrote:
For boolean types, `a ^ b` is a valid form for `a != b`. This means for
gimple_bitwise_inverted_equal_p, we catch some inverted value forms. This
patch extends inverted_equal_p to allow matching of `^` with the
corresponding `==`. Note in the testcase provided we used to optimize
in GCC 12 to just `return 0` where `a == b` was used,
this allows us to do that again.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

        PR tree-optimized/113186

gcc/ChangeLog:

        * gimple-match-head.cc (gimple_bitwise_inverted_equal_p):
        Match `^` with the `==` for 1bit integral types.
        * match.pd (maybe_cmp): Allow for bit_xor for 1bit
        integral types.

gcc/testsuite/ChangeLog:

        * gcc.dg/tree-ssa/bitops-bool-1.c: New test.
OK
jeff

Reply via email to