1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-ipa-cp-details -fdump-tree-vrp1" } */ 3 4 static __attribute__((noinline, noclone)) foo(int * p)5int foo (int *p) 6 { 7 if (!p) 8 return 0; 9 *p = 1; 10 } 11 12 struct st 13 { 14 int a; 15 int b; 16 }; 17 18 int arr1[10]; 19 int a; bar(struct st * s)20int bar (struct st *s) 21 { 22 int arr2[10]; 23 int b; 24 if (!s) 25 return 0; 26 foo (&s->a); 27 foo (&a); 28 foo (&b); 29 foo (&arr1[1]); 30 foo (&arr2[1]); 31 } 32 33 /* { dg-final { scan-ipa-dump "Setting nonnull for 0" "cp" } } */ 34 /* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */ 35