From 5e41e7f0928de55d189475fc14f7e6c9737cd507 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 10 Nov 2020 14:17:52 +0100 Subject: [PATCH] Early exit from irange::set for poly ints. My previous cleanups to irange::set moved the early exit when VARYING. This caused poly int varyings to be created with incorrect min/max. We can just set varying and exit for all poly ints. gcc/ChangeLog: * value-range.cc (irange::set): Early exit for poly ints. --- gcc/value-range.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index f83a824a982..b7ccba010e4 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -249,9 +249,11 @@ irange::set (tree min, tree max, value_range_kind kind) return; } - if (kind != VR_VARYING - && (POLY_INT_CST_P (min) || POLY_INT_CST_P (max))) - kind = VR_VARYING; + if (POLY_INT_CST_P (min) || POLY_INT_CST_P (max)) + { + set_varying (TREE_TYPE (min)); + return; + } // Nothing to canonicalize for symbolic ranges. if (TREE_CODE (min) != INTEGER_CST -- 2.30.2