PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-hoist-3.c
blob51ba59c9ab6b39430177c91a779228a5154c46ce
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
4 int test (int a, int b, int c, int g)
6 int d, e;
7 if (a)
8 d = b * c;
9 else
10 d = b - c;
11 e = b * c + g;
12 return d + e;
15 /* We should hoist and CSE only the multiplication. */
17 /* { dg-final { scan-tree-dump-times " \\* " 1 "pre" } } */
18 /* { dg-final { scan-tree-dump "Insertions: 1" "pre" } } */