This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][IPA-VRP] Teach tree-vrp to use the VR set in params


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]