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
+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
+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.
/* { 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)
}
/* { dg-final { scan-ipa-dump "Setting nonnull for 0" "cp" } } */
+/* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */
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)))
{