gnu/gcc/1f4cc0f7a14b52fdfbd02ac890cc7aedbdfb1979 match.pd: Fix .PARITY(~x) simplification [PR126471]
The parity(~X) simpliciation to parity(X) is incorrect for types with
odd element precision, in that case parity(~X) is equivalent to
parity(X) ^ 1.
The following patch fixes this.
2026-07-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/126471
* match.pd (parity(~X) is parity(X)): Only optimize this way
if element_precision is even, otherwise optimize into parity(X) ^ 1.
* gcc.dg/bitint-139.c: New test.
Reviewed-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
2 files changed