| 1 |
// PR rtl-optimization/113140 |
| 2 |
// Reduced testcase by Rainer Orth <[email protected]> |
| 3 |
|
| 4 |
// { dg-options "-O -w" } |
| 5 |
|
| 6 |
int *m(); |
| 7 |
struct StaticValue { |
| 8 |
long _val; |
| 9 |
void setM(int *) { _val = 0; } |
| 10 |
}; |
| 11 |
struct Value : StaticValue { |
| 12 |
template <typename T> T *as(); |
| 13 |
}; |
| 14 |
Value *alloc(); |
| 15 |
struct Scoped { |
| 16 |
Scoped() { |
| 17 |
Value v; |
| 18 |
ptr = alloc(); |
| 19 |
Value *__trans_tmp_1 = v.as<Value>(); |
| 20 |
ptr->setM(__trans_tmp_1 ? m() : 0); |
| 21 |
} |
| 22 |
Value *ptr; |
| 23 |
}; |
| 24 |
struct QObjectMethod { |
| 25 |
unsigned long long callInternal() const; |
| 26 |
}; |
| 27 |
unsigned long long QObjectMethod::callInternal() const { |
| 28 |
[] { |
| 29 |
if (Scoped(); 0) |
| 30 |
; |
| 31 |
}(); |
| 32 |
} |