PR tree-optimization/81627
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-hoist-4.c
blobfa206e67357a258d4ee4bceb1521f32834bc4f96
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* From PR21485. */
6 long
7 NumSift (long *array, int b, unsigned long k)
9 if (b)
10 if (array[k] < array[k + 1L])
11 ++k;
12 return array[k];
15 /* There should be only two loads left. And the final value in the
16 if (b) arm should be if-converted:
17 tem1 = array[k];
18 if (b)
19 tem1 = MAX (array[k+1], tem1)
20 return tem1; */
22 /* { dg-final { scan-tree-dump-times "= \\*" 2 "optimized" } } */
23 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "optimized" } } */
24 /* { dg-final { scan-tree-dump-times "= PHI" 1 "optimized" } } */