]> git.ipfire.org Git - thirdparty/gcc.git/commit
Do not pessimize range in set_nonzero_bits.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 2 Oct 2022 08:46:47 +0000 (10:46 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 3 Oct 2022 11:06:25 +0000 (13:06 +0200)
commitc0129d6b2a5f2b3cfedd213d48c95581f75312aa
tree513c7d1239f83a03e4dd455241b37ff567992693
parent7f6f1f521fc12d4dbbdd0766d8fb7121d1e5ea8d
Do not pessimize range in set_nonzero_bits.

Currently if we have a range of [0,0] and we set the nonzero bits to
1, the current code pessimizes the range to [0,1] because it assumes
the range is [1,1] plus the possibility of 0.  This fixes the
oversight.

gcc/ChangeLog:

* value-range.cc (irange::set_nonzero_bits): Do not pessimize range.
(range_tests_nonzero_bits): New test.
gcc/value-range.cc