| 1 |
// PR tree-optimization/39259 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-O2" } |
| 4 |
|
| 5 |
|
| 6 |
extern "C" int __mysetjmp () __attribute__ ((__returns_twice__)); |
| 7 |
|
| 8 |
class TContStatus {}; |
| 9 |
|
| 10 |
class TContEvent |
| 11 |
{ |
| 12 |
public: |
| 13 |
inline void Execute () throw(); |
| 14 |
}; |
| 15 |
|
| 16 |
class TCont |
| 17 |
{ |
| 18 |
public: |
| 19 |
TContStatus ReadD (void* buf, int deadline) |
| 20 |
{ |
| 21 |
TContEvent event; |
| 22 |
event.Execute (); |
| 23 |
return TContStatus(); |
| 24 |
} |
| 25 |
TContStatus ReadI (void *buf) |
| 26 |
{ |
| 27 |
return ReadD (buf, 1); |
| 28 |
} |
| 29 |
}; |
| 30 |
|
| 31 |
void TContEvent::Execute () throw () |
| 32 |
{ |
| 33 |
__mysetjmp(); |
| 34 |
} |
| 35 |
|
| 36 |
void Broken (TCont *mCont) |
| 37 |
{ |
| 38 |
mCont->ReadI(0); |
| 39 |
mCont->ReadI(0); |
| 40 |
} |