diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-07-24 07:55:02 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-07-24 17:00:51 +0200 |
commit | 8b8103dcd2624936bd1f56ac2ee63d1fb779a7e4 (patch) | |
tree | 63324e877c0b2e0b4f88025af9ae2ccbc1341b1a /gcc/value-query.cc | |
parent | 164758b02c44cba66e00103c118c6a4b5f76a812 (diff) | |
download | gcc-8b8103dcd2624936bd1f56ac2ee63d1fb779a7e4.zip gcc-8b8103dcd2624936bd1f56ac2ee63d1fb779a7e4.tar.gz gcc-8b8103dcd2624936bd1f56ac2ee63d1fb779a7e4.tar.bz2 |
Minor fixes to vr_values to not die on non integral types.
The legacy code in vr_values mostly works on integral types (with few
exceptions such as some conversions from float). This patch makes
vr_values::range_of_expr not die when asked for a range of an
unsupported type. It also keeps the min/max simplification code from
being called on non integrals, similarly to what many of the other
assignment code is doing.
This is all a nop on the current code, but will keep us from
misbehaving when VRP starts working on non-integrals.
Tested on x86-64 Linux.
gcc/ChangeLog:
* value-query.cc (range_query::get_value_range): Add assert.
* vr-values.cc (vr_values::range_of_expr): Make sure we don't ICE
on unsupported types in vr_values.
(simplify_using_ranges::simplify): Same.
Diffstat (limited to 'gcc/value-query.cc')
-rw-r--r-- | gcc/value-query.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/value-query.cc b/gcc/value-query.cc index 3560d19..decf5aa 100644 --- a/gcc/value-query.cc +++ b/gcc/value-query.cc @@ -167,6 +167,7 @@ range_query::free_value_range_equiv (value_range_equiv *v) const class value_range_equiv * range_query::get_value_range (const_tree expr, gimple *stmt) { + gcc_checking_assert (value_range_equiv::supports_p (TREE_TYPE (expr))); int_range_max r; if (range_of_expr (r, const_cast<tree> (expr), stmt)) return new (equiv_alloc->allocate ()) value_range_equiv (r); |