diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-01-16 09:21:52 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-01-16 09:21:52 +0100 |
commit | e2559c3945a09521ffe4f59669bc4d902ae77adb (patch) | |
tree | 0d9e7dc7f3ca5d311e691c467152a09b234733a2 /gcc/fortran/dump-parse-tree.c | |
parent | b673e7547fb95d1f0d5cd17ae9e3874742cade66 (diff) | |
download | gcc-e2559c3945a09521ffe4f59669bc4d902ae77adb.zip gcc-e2559c3945a09521ffe4f59669bc4d902ae77adb.tar.gz gcc-e2559c3945a09521ffe4f59669bc4d902ae77adb.tar.bz2 |
match.pd: Optimize ((cst << x) & 1) [PR96669]
While we had a ((1 << x) & 1) != 0 to x == 0 optimization already,
this patch adds ((cst << x) & 1) optimization too, this time the
second constant must be 1 though, not some power of two, but the first
one can be any constant. If it is even, the result is false, if it is
odd, the result is x == 0.
2021-01-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/96669
* match.pd ((CST << x) & 1 -> x == 0): New simplification.
* gcc.dg/tree-ssa/pr96669-1.c: Adjust regexp.
* gcc.dg/tree-ssa/pr96669-2.c: New test.
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
0 files changed, 0 insertions, 0 deletions