summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-27 12:11:37 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-27 12:11:37 +0000
commit51f829046537052f9cb60e38aaede2328b38a836 (patch)
tree8c053b5da7f1c56db168b7cdd1a95df2d2d751cc
parent90f06e32c5d037aa48e9b88f4d4334e1a10c13ef (diff)
downloadgcc-51f829046537052f9cb60e38aaede2328b38a836.tar.gz
2015-01-27 Richard Biener <rguenther@suse.de>
* tree-vrp.c (update_value_range): Intersect the range with old recorded SSA name range information. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220164 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vrp.c17
2 files changed, 22 insertions, 0 deletions
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 <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
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