Hi,

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index ecfab1f..23c12b5 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3759,8 +3759,10 @@ extract_range_basic (value_range *vr, gimple *stmt)
              && SSA_NAME_IS_DEFAULT_DEF (arg)
              && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
            {
+#if 0
              set_value_range_to_null (vr, type);
              return;
+#endif

It is not cleanest either, but better to test cfun->after_inlining

Thanks. Here is the patch which does this. Bootstrapped and regression tested with the rest of the patches in the series. Is this OK for trunk?

Thanks,
Kugan

gcc/ChangeLog:

2016-07-25  Kugan Vivekanandarajah  <kug...@linaro.org>

        * tree-vrp.c (extract_range_basic): Check cfun->after_inlining before
        folding call to __builtin_constant_p with parameters to false.
>From 4805ea975de0fd3b183b27324df1caa7ff29f887 Mon Sep 17 00:00:00 2001
From: Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org>
Date: Sat, 25 Jun 2016 11:52:57 +1000
Subject: [PATCH 2/7] Prevent setting __builtin_constant_p of param to null
 before inlining in Early VRP

---
 gcc/tree-vrp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index bdfc1b6..edaacf2 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3763,7 +3763,8 @@ extract_range_basic (value_range *vr, gimple *stmt)
 	  arg = gimple_call_arg (stmt, 0);
 	  if (TREE_CODE (arg) == SSA_NAME
 	      && SSA_NAME_IS_DEFAULT_DEF (arg)
-	      && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
+	      && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL
+	      && cfun->after_inlining)
 	    {
 	      set_value_range_to_null (vr, type);
 	      return;
-- 
1.9.1

Reply via email to