diff mbox

[RFC,IPA-VRP] Disable setting param of __builtin_constant_p to null

Message ID b161b91a-1fdf-638a-60cb-3ef5367d100f@linaro.org
State New
Headers show

Commit Message

Kugan Vivekanandarajah July 25, 2016, 6:59 a.m. UTC
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  <kuganv@linaro.org>

	* tree-vrp.c (extract_range_basic): Check cfun->after_inlining before
	folding call to __builtin_constant_p with parameters to false.

Comments

Richard Biener July 25, 2016, 10:02 a.m. UTC | #1
On Mon, Jul 25, 2016 at 8:59 AM, kugan
<kugan.vivekanandarajah@linaro.org> wrote:
> 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?

Ok.

Richard.

> Thanks,
> Kugan
>
> gcc/ChangeLog:
>
> 2016-07-25  Kugan Vivekanandarajah  <kuganv@linaro.org>
>
>         * tree-vrp.c (extract_range_basic): Check cfun->after_inlining
> before
>         folding call to __builtin_constant_p with parameters to false.
diff mbox

Patch

From 4805ea975de0fd3b183b27324df1caa7ff29f887 Mon Sep 17 00:00:00 2001
From: Kugan Vivekanandarajah <kugan.vivekanandarajah@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