From 1900ff9210f1dd673f815b3a421c6ec1e02f6e05 Mon Sep 17 00:00:00 2001
From: Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
Date: Thu, 14 Jul 2016 19:28:10 +1000
Subject: [PATCH 6/6] Teach tree-vrp to use ipa-vrp results
---
gcc/tree-vrp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -667,6 +667,20 @@ get_value_range (const_tree var)
if (POINTER_TYPE_P (TREE_TYPE (sym))
&& nonnull_arg_p (sym))
set_value_range_to_nonnull (vr, TREE_TYPE (sym));
+ else if (!POINTER_TYPE_P (TREE_TYPE (sym)))
+ {
+ wide_int min, max;
+ value_range_type rtype = get_range_info (var, &min, &max);
+ if (rtype == VR_RANGE || rtype == VR_ANTI_RANGE)
+ {
+ vr->type = rtype;
+ vr->min = wide_int_to_tree (TREE_TYPE (var), min);
+ vr->max = wide_int_to_tree (TREE_TYPE (var), max);
+ vr->equiv = NULL;
+ }
+ else
+ set_value_range_to_varying (vr);
+ }
else
set_value_range_to_varying (vr);
}
--
1.9.1