2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / 20121105-1.C
blob10eeeb90945132a09e1093e9d198f20d81d61007
1 // PR tree-optimization/54986
2 // Reported by Remi Vanicat <vanicat@debian.org>
3 // Reduced testcase by Markus Trippelsdorf <markus@trippelsdorf.de> 
5 __extension__ typedef __INTPTR_TYPE__ intptr_t;
7 struct A;
8 struct B
10   int *_ptr;
11   bool operator==(B *p1)
12   {
13     return p1->_ptr;
14   }
16 struct C {
17   A* ref_SYMBptr();
19 struct A
21   B sommet;
23 typedef C *gen_op_context;
24 struct D
26   D(gen_op_context) {}
29 D c(0);
30 const intptr_t d = (intptr_t)&c;
31 B *const   e = (B *)&d;
33 static bool
34 fn1(C& p1)
36   return p1.ref_SYMBptr()->sommet == e;
39 void
40 fn2()
42   C b;
43   fn1(b);