PR tree-optimization/55079
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-1.c
blob3bc0f5e3e6e32cb4930d95175f9f11eddac600d9
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)
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)
14 c = argc + 3;
16 printf ("%d, %d\n", a, b + c);
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" } } */