| 1 |
// PR tree-optimization/54986 |
| 2 |
// Reported by Remi Vanicat <[email protected]> |
| 3 |
// Reduced testcase by Markus Trippelsdorf <[email protected]> |
| 4 |
|
| 5 |
__extension__ typedef __INTPTR_TYPE__ intptr_t; |
| 6 |
|
| 7 |
struct A; |
| 8 |
struct B |
| 9 |
{ |
| 10 |
int *_ptr; |
| 11 |
bool operator==(B *p1) |
| 12 |
{ |
| 13 |
return p1->_ptr; |
| 14 |
} |
| 15 |
}; |
| 16 |
struct C { |
| 17 |
A* ref_SYMBptr(); |
| 18 |
}; |
| 19 |
struct A |
| 20 |
{ |
| 21 |
B sommet; |
| 22 |
}; |
| 23 |
typedef C *gen_op_context; |
| 24 |
struct D |
| 25 |
{ |
| 26 |
D(gen_op_context) {} |
| 27 |
}; |
| 28 |
|
| 29 |
D c(0); |
| 30 |
const intptr_t d = (intptr_t)&c; |
| 31 |
B *const e = (B *)&d; |
| 32 |
|
| 33 |
static bool |
| 34 |
fn1(C& p1) |
| 35 |
{ |
| 36 |
return p1.ref_SYMBptr()->sommet == e; |
| 37 |
} |
| 38 |
|
| 39 |
void |
| 40 |
fn2() |
| 41 |
{ |
| 42 |
C b; |
| 43 |
fn1(b); |
| 44 |
} |