From 8b8103dcd2624936bd1f56ac2ee63d1fb779a7e4 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Sun, 24 Jul 2022 07:55:02 +0200 Subject: 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. --- gcc/value-query.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/value-query.cc') 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 (expr), stmt)) return new (equiv_alloc->allocate ()) value_range_equiv (r); -- cgit v1.1