diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-11-04 22:24:42 +0100 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-11-07 20:59:21 +0100 |
commit | a239a63f868e29e9276088e7c0fb00804c2903ba (patch) | |
tree | 90e71e763b7c61617545033ba4522df8073f847b /gcc/gimple-range.cc | |
parent | 03ed4e57e3d46a61513b3d1ab1720997aec8cf71 (diff) | |
download | gcc-a239a63f868e29e9276088e7c0fb00804c2903ba.zip gcc-a239a63f868e29e9276088e7c0fb00804c2903ba.tar.gz gcc-a239a63f868e29e9276088e7c0fb00804c2903ba.tar.bz2 |
Improve multiplication by powers of 2 in range-ops.
For unsigned numbers, multiplication by X, where X is a power of 2 is
[0,0][X,+INF].
This patch causes a regression to g++.dg/pr71488.C where
-Wstringop-overflow gets the same IL as before, but better ranges
cause it to issue a bogus warning. I will create a PR with some
notes.
No discernible changes in performance.
Tested on x86-64 Linux.
PR tree-optimization/55157
gcc/ChangeLog:
* range-op.cc (operator_mult::wi_fold): Optimize multiplications
by powers of 2.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr55157.c: New test.
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions