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
This commit is contained in:
parent
718625ad3a
commit
7fd4f180b4
4 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
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
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-ipa-cp-details" } */
|
||||
/* { dg-options "-O2 -fdump-ipa-cp-details -fdump-tree-vrp1" } */
|
||||
|
||||
static __attribute__((noinline, noclone))
|
||||
int foo (int *p)
|
||||
|
@ -25,3 +25,4 @@ int bar (struct st *s)
|
|||
}
|
||||
|
||||
/* { 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)
|
|||
anti-ranges for pointers. Note that this is only valid with
|
||||
default definitions of PARM_DECLs. */
|
||||
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));
|
||||
else if (INTEGRAL_TYPE_P (TREE_TYPE (sym)))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue