1 /* { dg-options "-Os -fdump-rtl-hoist" } */
2 /* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
3 /* { dg-final { cleanup-rtl-dump "hoist" } } */
4
5 #define BUF 100
6 int a[BUF];
7
8 void com (int);
9 void bar (int);
10
foo(int x,int y,int z)11 int foo (int x, int y, int z)
12 {
13 /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
14 because its rtx_cost is too small. */
15 if (z)
16 {
17 a[1] = a[0];
18 a[2] = a[1];
19 a[3] = a[3];
20 a[4] = a[5];
21 a[5] = a[7];
22 a[6] = a[11];
23 a[7] = a[13];
24 a[8] = a[17];
25 com (x+y);
26 }
27 else
28 {
29 bar (x+y);
30 }
31
32 return 0;
33 }
34