]>
Commit | Line | Data |
---|---|---|
17f6e37d JJ |
1 | /* { dg-require-effective-target freorder } */ |
2 | /* { dg-options "-O2 -freorder-blocks-and-partition" } */ | |
3 | ||
4 | struct A { A () __attribute__((noinline)); ~A () __attribute__((noinline)); }; | |
5 | A::A () { asm volatile ("" : : : "memory"); } | |
6 | A::~A () { asm volatile ("" : : : "memory"); } | |
7 | ||
8 | int bar () __attribute__((noinline)); | |
9 | void foo () __attribute__((noinline)); | |
10 | ||
11 | volatile int k, l; | |
12 | ||
13 | int bar (int i) | |
14 | { | |
15 | void *p = __builtin_alloca (i); | |
16 | asm volatile ("" : : "r" (i), "r" (p) : "memory"); | |
17 | if (k) throw 6; | |
18 | return ++l; | |
19 | } | |
20 | ||
21 | void foo () | |
22 | { | |
23 | A a; | |
24 | try { | |
25 | A b; | |
26 | int i = bar (5); | |
27 | try { throw 6; } catch (int) {} | |
28 | if (__builtin_expect (i < 4500, 0)) { | |
29 | bar (7); | |
30 | try { bar (8); } catch (long) {} | |
31 | bar (10); | |
32 | if (__builtin_expect (i < 0, 0)) { | |
33 | try { bar (12); } catch (...) {} | |
34 | bar (16); | |
35 | bar (122); | |
36 | } else { | |
37 | try { bar (bar (7)); } catch (int) {} | |
38 | } | |
39 | } else { | |
40 | try { bar (bar (bar (9))); } catch (...) {} | |
41 | bar (5); | |
42 | } | |
43 | } catch (...) { | |
44 | } | |
45 | } | |
46 | ||
47 | int | |
48 | main () | |
49 | { | |
50 | int i; | |
51 | for (i = 0; i < 10000; i++) | |
52 | foo (); | |
53 | } |