This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC][IPA-VRP] Teach tree-vrp to use the VR set in params
- From: kugan <kugan dot vivekanandarajah at linaro dot org>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, Martin Jambor <mjambor at suse dot cz>
- Date: Fri, 15 Jul 2016 14:47:40 +1000
- Subject: [RFC][IPA-VRP] Teach tree-vrp to use the VR set in params
- Authentication-results: sourceware.org; auth=none
- References: <57886949.8010300@linaro.org>
Hi,
This patch teaches tree-vrp to use the VR set in params.
Thanks,
Kugan
gcc/ChangeLog:
2016-07-14 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-vrp.c (get_value_range): Teach PARM_DECL to use ipa-vrp
results.
>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(+)
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 8c87c06..ad3891c 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -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