[ipa-vrp] ice in set_value_range

kugan kugan.vivekanandarajah@linaro.org
Fri Oct 28 02:58:00 GMT 2016


Hi,

>>      {
>>        tree val = ipa_get_jf_constant (jfunc);
>>        if (TREE_CODE (val) == INTEGER_CST)
>>  	{
>> +	  value_range vr;
>>  	  if (TREE_OVERFLOW_P (val))
>>  	    val = drop_tree_overflow (val);
>> -	  jfunc->vr_known = true;
>> -	  jfunc->m_vr.type = VR_RANGE;
>> -	  jfunc->m_vr.min = val;
>> -	  jfunc->m_vr.max = val;
>> +
>> +	  vr.type = VR_RANGE;
>> +	  vr.min = val;
>> +	  vr.max = val;
>> +	  vr.equiv = NULL;
>> +	  extract_range_from_unary_expr (&jfunc->m_vr,
>> +					 NOP_EXPR,
>> +					 param_type,
>> +					 &vr, TREE_TYPE (val));
>
> Do I understand it correctly that extract_range_from_unary_expr deals
> with any potential type conversions better (compared to what you did
> before here)?

Yes, this can be wrong at times too as reported in 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78121. I have separated 
this part of the patch with a testcase.

Please note that I am using fold_convert in the attached patch.

Bootstrapped and regression tested on x86_64-linux-gnu with no new 
regressions. Is this OK for trunk?

Thanks,
Kugan


gcc/ChangeLog:

2016-10-28  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/78121
	* ipa-cp.c (propagate_vr_accross_jump_function): Pass param type.
	Also fold constant passed as argument while computing value range.
	(propagate_constants_accross_call): Pass param type.
	* ipa-prop.c: export ipa_get_callee_param_type.
	* ipa-prop.h: export ipa_get_callee_param_type.

gcc/testsuite/ChangeLog:

2016-10-28  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/78121
	* gcc.dg/ipa/pr78121.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-convertion.patch
Type: text/x-patch
Size: 4163 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161028/c4b2d6c4/attachment.bin>


More information about the Gcc-patches mailing list