Commit a03df1d5 by Kugan Vivekanandarajah Committed by Kugan Vivekanandarajah

Use ipa-vrp result in tree-vrp

gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	 * tree-vrp.c (get_value_range): Teach PARM_DECL to use ipa-vrp
	 results.


gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* gcc.dg/guality/pr54519-1.c: Add -fno-ipa-vrp. Else constant
	arguments/compare will be optimized away.
	* gcc.dg/torture/ftrapv-1.c: Likewise.

From-SVN: r240293
parent 8bc5448f
2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-vrp.c (get_value_range): Teach PARM_DECL to use ipa-vrp
results.
2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org>
* common.opt: New option -fipa-vrp.
* ipa-cp.c (ipa_get_vr_lat): New.
(ipcp_vr_lattice::print): Likewise.
......
2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org>
* gcc.dg/guality/pr54519-1.c: Add -fno-ipa-vrp. Else constant
arguments/compare will be optimized away.
* gcc.dg/torture/ftrapv-1.c: Likewise.
2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org>
* g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments
will be optimized away.
* gcc.dg/ipa/vrp1.c: New test.
......
/* PR debug/54519 */
/* { dg-do run } */
/* { dg-options "-g" } */
/* { dg-options "-g -fno-ipa-vrp" } */
__attribute__((noinline, noclone)) void
fn1 (int x)
......
/* { dg-do run } */
/* { dg-additional-options "-ftrapv" } */
/* { dg-additional-options "-ftrapv -fno-ipa-vrp" } */
/* { dg-require-effective-target trapping } */
/* { dg-require-fork "" } */
......
......@@ -687,6 +687,18 @@ 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 (INTEGRAL_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)
set_value_range (vr, rtype,
wide_int_to_tree (TREE_TYPE (var), min),
wide_int_to_tree (TREE_TYPE (var), max),
NULL);
else
set_value_range_to_varying (vr);
}
else
set_value_range_to_varying (vr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment