]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix PR110726: a | (a == b) can sometimes produce wrong code
authorAndrew Pinski <apinski@marvell.com>
Tue, 18 Jul 2023 21:11:46 +0000 (21:11 +0000)
committerAndrew Pinski <apinski@marvell.com>
Wed, 19 Jul 2023 16:14:27 +0000 (16:14 +0000)
commitbf20b770d9aabb15faf2644b5e3106249cb175f3
tree409d605d4680799f0f2a5f791028e2e49ba692f5
parent344f41322023cdbf4532b5278443a22a4f391627
Fix PR110726: a | (a == b) can sometimes produce wrong code

So I had missed/forgot that EQ_EXPR could have an non boolean
type for generic when I implemented r14-2556-g0407ae8a7732d9.
This patch adds check for one bit precision intergal type
which fixes the problem.

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

PR tree-optimization/110726

gcc/ChangeLog:

* match.pd ((a|b)&(a==b),a|(a==b),(a&b)|(a==b)):
Add checks to make sure the type was one bit precision
intergal type.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/bitops-1.c: New test.
gcc/match.pd
gcc/testsuite/gcc.c-torture/execute/bitops-1.c [new file with mode: 0644]