]> gcc.gnu.org Git - gcc.git/commit
Cache irange::num_pairs() for non-legacy code.
authorAldy Hernandez <aldyh@redhat.com>
Sat, 17 Apr 2021 15:44:37 +0000 (17:44 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 26 Apr 2021 16:21:02 +0000 (18:21 +0200)
commitdb3581c4ae4d44edea2b64347095d14363721668
tree76e5c19deffe47516e2e0dbfeaa4b7354001c2a1
parentdc80d5e887ea4fa0e1e950db5f6bdd765c960c22
Cache irange::num_pairs() for non-legacy code.

This does for num_pairs() what my previous patch did for VR_UNDEFINED
and VR_VARYING.

Note that VR_ANTI_RANGE for legacy is always set to 2 ranges.  There
is only one way of representing a range, so a range that can be
represented as a VR_RANGE will never have a kind of VR_ANTI_RANGE.
Also legacy symbolics can also use VR_ANTI_RANGE, but no one will ever
ask for the bounds of such range, so m_num_ranges is irrelevant.

gcc/ChangeLog:

* value-range.cc (irange::legacy_num_pairs): Remove.
(irange::invert): Change gcc_assert to gcc_checking_assert.
* value-range.h (irange::num_pairs): Adjust for a cached
num_pairs().  Also, rename all gcc_assert's to
gcc_checking_assert's.
gcc/value-range.cc
gcc/value-range.h
This page took 0.057161 seconds and 5 git commands to generate.