Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / gcc.dg / hoist-register-pressure-2.c
blob30408f318c4d070de59bc61c504d8a725030f133
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" } } */
5 #define BUF 100
6 int a[BUF];
8 void com (int);
9 void bar (int);
11 int foo (int x, int y, int z)
13 /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
14 because its rtx_cost is too small. */
15 if (z)
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);
27 else
29 bar (x+y);
32 return 0;