diff options
author | guojiufu <guojiufu@linux.ibm.com> | 2020-10-19 13:48:19 +0800 |
---|---|---|
committer | guojiufu <guojiufu@linux.ibm.com> | 2020-10-19 17:26:41 +0800 |
commit | 222f312a773157f53396ba4cb287deb07f84cc34 (patch) | |
tree | d865a929bc4d8d6f467ce98e33831931f4a50451 /gcc/ada | |
parent | dccb0f8801363462a11fd13a33ff3f4092ff82bd (diff) | |
download | gcc-222f312a773157f53396ba4cb287deb07f84cc34.zip gcc-222f312a773157f53396ba4cb287deb07f84cc34.tar.gz gcc-222f312a773157f53396ba4cb287deb07f84cc34.tar.bz2 |
[PATCH] fold x << (n % C) to x << (n & C-1) if C meets power2
This patch fixes PR66552 which is also as:
https://gcc.gnu.org/pipermail/gcc-patches/2020-February/540930.html
which requests to optimizes (x shift (n mod C)) to
(x shift (n bit_and (C - 1))) when C is a constant and power of two.
gcc/ChangeLog
2020-10-19 Li Jia He <helijia@gcc.gnu.org>
PR tree-optimization/66552
* match.pd (x << (n % C) -> x << (n & C-1)): New simplification.
gcc/testsuite/ChangeLog
2020-10-19 Li Jia He <helijia@gcc.gnu.org>
PR tree-optimization/66552
* gcc.dg/pr66552.c: New testcase.
Diffstat (limited to 'gcc/ada')
0 files changed, 0 insertions, 0 deletions