aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-09-20 14:54:31 -0700
committerAndrew Pinski <pinskia@gmail.com>2023-09-26 08:01:18 -0700
commitc3c6f30496d945b77dcb7f4ad8c3f8094f5a64a4 (patch)
tree37f490138e1ea09e1c889303f4337b369ad50f71 /gcc/system.h
parent68fa82e2d8f868a233103102dff2449a416bc566 (diff)
downloadgcc-c3c6f30496d945b77dcb7f4ad8c3f8094f5a64a4.zip
gcc-c3c6f30496d945b77dcb7f4ad8c3f8094f5a64a4.tar.gz
gcc-c3c6f30496d945b77dcb7f4ad8c3f8094f5a64a4.tar.bz2
MATCH: Simplify `(A ==/!= B) &/| (((cast)A) CMP C)`
This patch adds support to the pattern for `(A == B) &/| (A CMP C)` where the second A could be casted to a different type. Some were handled correctly if using seperate `if` statements but not if combined with BIT_AND/BIT_IOR. In the case of pr111456-1.c, the testcase would pass if `--param=logical-op-non-short-circuit=0` was used but now can be optimized always. OK? Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/106164 PR tree-optimization/111456 gcc/ChangeLog: * match.pd (`(A ==/!= B) & (A CMP C)`): Support an optional cast on the second A. (`(A ==/!= B) | (A CMP C)`): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/cmpbit-6.c: New test. * gcc.dg/tree-ssa/cmpbit-7.c: New test. * gcc.dg/tree-ssa/pr111456-1.c: New test.
Diffstat (limited to 'gcc/system.h')
0 files changed, 0 insertions, 0 deletions