]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/ssa-hoist-8.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-hoist-8.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
3
4 int mem;
5 void foo ();
6 int bar (int flag)
7 {
8 int res;
9 foo ();
10 /* Hoist the load of mem here even though foo () clobbers it. */
11 if (flag)
12 res = mem;
13 else
14 {
15 res = mem;
16 mem = 2;
17 }
18 return res;
19 }
20
21 /* { dg-final { scan-tree-dump "HOIST inserted: 1" "pre" } } */
22 /* { dg-final { scan-tree-dump-times " = mem;" 1 "pre" } } */