diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2020-05-14 19:36:00 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2020-05-14 19:37:12 +0200 |
commit | 07a3e492431f314bc93f6845efe4a3282b621365 (patch) | |
tree | 2d1718e86971f78f0638002d644a6d5abea49e65 | |
parent | b454a26fc2228ee93ccec766a619520a599c764d (diff) | |
download | gcc-07a3e492431f314bc93f6845efe4a3282b621365.zip gcc-07a3e492431f314bc93f6845efe4a3282b621365.tar.gz gcc-07a3e492431f314bc93f6845efe4a3282b621365.tar.bz2 |
Fix off-by-one error in popcount folding.
-rw-r--r-- | gcc/gimple-range-cfg.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimple-range-cfg.cc b/gcc/gimple-range-cfg.cc index 0ed06a2..23cef01 100644 --- a/gcc/gimple-range-cfg.cc +++ b/gcc/gimple-range-cfg.cc @@ -300,7 +300,7 @@ gimple_ranger::range_of_builtin_call (irange &r, gcall *call) if (!r.undefined_p ()) { wide_int max = r.upper_bound (); - maxi = wi::floor_log2 (max); + maxi = wi::floor_log2 (max) + 1; } r.set (build_int_cst (type, mini), build_int_cst (type, maxi)); return true; |