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

Message ID CAFiYyc2sd2Ehw8ZRDzShYsSYXYtu+eQM33i47+t5q9Wtjk58gQ@mail.gmail.com
State New
Headers show

Commit Message

Richard Biener July 18, 2016, 11:33 a.m. UTC
On Fri, Jul 15, 2016 at 6:47 AM, kugan
<kugan.vivekanandarajah@linaro.org> wrote:
> Hi,
>
>
>
> This patch teaches tree-vrp to use the VR set in params.


+               }
+             else
+               set_value_range_to_varying (vr);
+           }


Ok with that change.

Thanks,
Richard.

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

Patch
diff mbox

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

Please use INTEGRAL_TYPE_P

+           {
+             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;

Use

     set_value_range (vr, rtype, wide_int..., ..., NULL);