111
|
1 /* { dg-do compile } */
|
|
2 /* { dg-options "-O2 -fno-ipa-vrp -fdump-tree-optimized" } */
|
|
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))
|
|
10 int a(int a)
|
|
11 {
|
|
12 if (a>0)
|
|
13 return b(a-1);
|
|
14 return *ptr == *ptr;
|
|
15 }
|
|
16 inline
|
|
17 __attribute__ ((noinline))
|
|
18 static int b(int p)
|
|
19 {
|
|
20 if (p<0)
|
|
21 return a(p+1);
|
|
22 return 1;
|
|
23 }
|
131
|
24 int main()
|
111
|
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" } } */
|