From 755359b75ee55bb1a34c34bb90ff91a11ad83568 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 27 Jan 2015 12:11:37 +0000 Subject: [PATCH] tree-vrp.c (update_value_range): Intersect the range with old recorded SSA name range information. 2015-01-27 Richard Biener * tree-vrp.c (update_value_range): Intersect the range with old recorded SSA name range information. From-SVN: r220164 --- gcc/ChangeLog | 5 +++++ gcc/tree-vrp.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 213dfe94e0d..a4efbafb852 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-27 Richard Biener + + * tree-vrp.c (update_value_range): Intersect the range with + old recorded SSA name range information. + 2015-01-27 Nick Clifton * config/rl78/rl78.c (rl78_expand_prologue): In G10 mode push the diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index c5ca2876b57..2bc22c6b57b 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -847,6 +847,23 @@ update_value_range (const_tree var, value_range_t *new_vr) value_range_t *old_vr; bool is_new; + /* If there is a value-range on the SSA name from earlier analysis + factor that in. */ + if (INTEGRAL_TYPE_P (TREE_TYPE (var))) + { + wide_int min, max; + value_range_type rtype = get_range_info (var, &min, &max); + if (rtype == VR_RANGE || rtype == VR_ANTI_RANGE) + { + value_range_d nr; + nr.type = rtype; + nr.min = wide_int_to_tree (TREE_TYPE (var), min); + nr.max = wide_int_to_tree (TREE_TYPE (var), max); + nr.equiv = NULL; + vrp_intersect_ranges (new_vr, &nr); + } + } + /* Update the value range, if necessary. */ old_vr = get_value_range (var); is_new = old_vr->type != new_vr->type