OSDN Git Service

2005-07-18 Andrew Pinski <pinskia@physics.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / alias-2.c
1 /* { dg-options "-O2 -fdump-tree-optimized" } */
2 static int a;
3 int f;
4 void bar (void)  __attribute__((noinline));
5 void bar (void)
6 {
7   f = 9;
8 }
9
10 void link_error ();
11
12 int foo()
13 {
14   int b, c;
15   a = 5;
16   b = a;
17   bar ();
18   b = b + a;
19   if (b != 10)
20     link_error ();
21   return b;
22 }
23
24 /* We should have removed the link_error on the tree level as GCC can tell that
25    a is not touched by the calling bar at all. */
26 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
27 /* { dg-final { cleanup-tree-dump "optimized" } } */