]> git.ipfire.org Git - thirdparty/gcc.git/commit
Clear nonzero mask when inverting ranges.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 13 Jul 2022 10:38:35 +0000 (12:38 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 13 Jul 2022 14:25:28 +0000 (16:25 +0200)
commit554b21edb9ec91a898125d4915d790c6d4b9a688
tree101ee95fab350ed3a93e545bf920df5b07cab1c5
parentc7970b146f98f58a803a37e9a0b21bb97f1dadd8
Clear nonzero mask when inverting ranges.

Every time we set a range we should take into account the nonzero
mask.  This happens automatically for the set() methods, plus all the
other assignment, intersect, and union methods.  Unfortunately I
forgot about the invert code.

Also, for good measure I audited the rest of the setters in
value_range.cc and plugged the legacy code to pessimize the masks to
-1 for union/intersect, since we don't support the masks on them (or
rather, we don't keep very good track of them).

Tested on x86-64 Linux.

gcc/ChangeLog:

* value-range.cc (irange::copy_to_legacy): Set nonzero mask.
(irange::legacy_intersect): Clear nonzero mask.
(irange::legacy_union): Same.
(irange::invert): Same.
gcc/value-range.cc