1 /* PR rtl-optimization/98289 */
2 /* { dg-do compile { target freorder } } */
3 /* { dg-options "-O2 -freorder-blocks-and-partition" } */
4
5 int bar (void) __attribute__((cold));
6
7 void
8 foo (int x)
9 {
10 if (x)
11 __builtin_abort ();
12 }
13
14 void
15 baz (int x)
16 {
17 if (__builtin_expect (x, 0))
18 {
19 bar ();
20 bar ();
21 bar ();
22 }
23 }
24
25 void
26 qux (int x, int y, int z, int w)
27 {
28 if (x || y || z || w)
29 __builtin_abort ();
30 }
31
32 int
33 corge (int x, int y, int z, int w, int u)
34 {
35 if (__builtin_expect (x, 0))
36 goto lab;
37 u++;
38 if (__builtin_expect (y, 0))
39 goto lab;
40 u *= 2;
41 if (__builtin_expect (z, 0))
42 goto lab;
43 u |= 42;
44 if (__builtin_expect (w, 0))
45 {
46 lab:;
47 bar ();
48 bar ();
49 if (bar () > 32) goto lab;
50 }
51 return u;
52 }