diff options
author | Martin Liska <mliska@suse.cz> | 2017-10-12 23:53:21 +0200 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-10-12 15:53:21 -0600 |
commit | 0af377c15a40ae329f6019155d07857df452f42b (patch) | |
tree | 693e21e454052f1912690ef8c070dde06b757ea4 /gcc/tree-ssa-dse.c | |
parent | c64959bdf1388d332159cb5d40afddc30d8c61d2 (diff) | |
download | gcc-0af377c15a40ae329f6019155d07857df452f42b.zip gcc-0af377c15a40ae329f6019155d07857df452f42b.tar.gz gcc-0af377c15a40ae329f6019155d07857df452f42b.tar.bz2 |
re PR tree-optimization/82493 (UBSAN in gcc/sbitmap.c:368:28: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int')
PR tree-optimization/82493
* sbitmap.c (bitmap_bit_in_range_p): Fix the implementation.
(test_range_functions): New function.
(sbitmap_c_tests): Likewise.
* selftest-run-tests.c (selftest::run_tests): Run new tests.
* selftest.h (sbitmap_c_tests): New function.
* tree-ssa-dse.c (live_bytes_read): Fix thinko.
From-SVN: r253699
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r-- | gcc/tree-ssa-dse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 87e2fce..9d6cb14 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -493,7 +493,7 @@ live_bytes_read (ao_ref use_ref, ao_ref *ref, sbitmap live) /* Now check if any of the remaining bits in use_ref are set in LIVE. */ unsigned int start = (use_ref.offset - ref->offset) / BITS_PER_UNIT; - unsigned int end = (use_ref.offset + use_ref.size) / BITS_PER_UNIT; + unsigned int end = ((use_ref.offset + use_ref.size) / BITS_PER_UNIT) - 1; return bitmap_bit_in_range_p (live, start, end); } return true; |