tree-vrp.c (update_value_range): Intersect the range with old recorded SSA name range information.

2015-01-27  Richard Biener  <rguenther@suse.de>

	* tree-vrp.c (update_value_range): Intersect the range with
	old recorded SSA name range information.

From-SVN: r220164
This commit is contained in:
Richard Biener 2015-01-27 12:11:37 +00:00 committed by Richard Biener
parent eb42aba984
commit 755359b75e
2 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2015-01-27 Richard Biener <rguenther@suse.de>
* tree-vrp.c (update_value_range): Intersect the range with
old recorded SSA name range information.
2015-01-27 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_expand_prologue): In G10 mode push the

View File

@ -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