Commit 7fd4f180 by Kugan Vivekanandarajah Committed by Kugan Vivekanandarajah

Use get_ptr_nonnull in tree-vrp

Use get_ptr_nonnull in tree-vrp
gcc/testsuite/ChangeLog:

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

	* gcc.dg/ipa/vrp4.c: Adjust testcase.

gcc/ChangeLog:

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

	* tree-vrp.c (get_value_range): Check get_ptr_nonnull.

From-SVN: r241289
parent 718625ad
2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org> 2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-vrp.c (get_value_range): Check get_ptr_nonnull.
2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org>
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Set value range * ipa-prop.c (ipa_compute_jump_functions_for_edge): Set value range
for pointer type too. for pointer type too.
(ipcp_update_vr): set_ptr_nonnull for pointer. (ipcp_update_vr): set_ptr_nonnull for pointer.
......
2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org> 2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org>
* gcc.dg/ipa/vrp4.c: Adjust testcase.
2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org>
* gcc.dg/ipa/vrp4.c: New test. * gcc.dg/ipa/vrp4.c: New test.
2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org> 2016-10-18 Kugan Vivekanandarajah <kuganv@linaro.org>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-cp-details" } */ /* { dg-options "-O2 -fdump-ipa-cp-details -fdump-tree-vrp1" } */
static __attribute__((noinline, noclone)) static __attribute__((noinline, noclone))
int foo (int *p) int foo (int *p)
...@@ -25,3 +25,4 @@ int bar (struct st *s) ...@@ -25,3 +25,4 @@ int bar (struct st *s)
} }
/* { dg-final { scan-ipa-dump "Setting nonnull for 0" "cp" } } */ /* { dg-final { scan-ipa-dump "Setting nonnull for 0" "cp" } } */
/* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */
...@@ -685,7 +685,8 @@ get_value_range (const_tree var) ...@@ -685,7 +685,8 @@ get_value_range (const_tree var)
anti-ranges for pointers. Note that this is only valid with anti-ranges for pointers. Note that this is only valid with
default definitions of PARM_DECLs. */ default definitions of PARM_DECLs. */
if (POINTER_TYPE_P (TREE_TYPE (sym)) if (POINTER_TYPE_P (TREE_TYPE (sym))
&& nonnull_arg_p (sym)) && (nonnull_arg_p (sym)
|| get_ptr_nonnull (var)))
set_value_range_to_nonnull (vr, TREE_TYPE (sym)); set_value_range_to_nonnull (vr, TREE_TYPE (sym));
else if (INTEGRAL_TYPE_P (TREE_TYPE (sym))) else if (INTEGRAL_TYPE_P (TREE_TYPE (sym)))
{ {
......
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