OSDN Git Service

PR tree-optimization/51799
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
3 extern int printf (const char *, ...);
4 int foo(int argc, char **argv)
5 {
6         int a;
7         int b;
8         int c;
9         b  = argc + 1;
10         c =  argc + 2;
11         a = b + c;
12         if (argc * 2)
13         {
14                 c = argc + 3;
15         }
16         printf ("%d, %d\n", a, b + c);
17 }
18 /* We should eliminate one evaluation of b + c along the main path,
19    causing one reload. */
20 /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
21 /* { dg-final { cleanup-tree-dump "pre" } } */