1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fno-ipa-vrp -fdump-tree-optimized -fno-tree-ccp" } */ 3 int *ptr; 4 static int barvar; 5 static int b(int a); 6 /* We can not detect A to be const because it may be interposed by unoptimized 7 body. */ 8 inline 9 __attribute__ ((noinline)) a(int a)10int a(int a) 11 { 12 if (a>0) 13 return b(a-1); 14 return *ptr == *ptr; 15 } 16 inline 17 __attribute__ ((noinline)) b(int p)18static int b(int p) 19 { 20 if (p<0) 21 return a(p+1); 22 return 1; 23 } main()24int main() 25 { 26 int aa; 27 ptr = &barvar; 28 aa=!b(3); 29 ptr = 0; 30 return aa; 31 } 32 /* { dg-final { scan-tree-dump "barvar" "optimized" } } */ 33