1 // PR rtl-optimization/48549
3 // { dg-options "-fcompare-debug -O2" }
4 // { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } }
6 __extension__ typedef __PTRDIFF_TYPE__ pdiff_t;
9 foo (void *from, void *to)
11 pdiff_t offset = reinterpret_cast <pdiff_t>(to)
12 - reinterpret_cast <pdiff_t>(from);
13 if (offset != static_cast <int>(offset))
15 reinterpret_cast <int *>(from)[1] = offset;
20 A (void *x) : a (x) {}
21 void *bar () { return a; }
36 C (void *x) : E (x) {}
40 D (void *x) : E (x) {}
45 return (reinterpret_cast <char *>(bar ()) + x);
50 return reinterpret_cast <char *>(bar ());
61 for (unsigned i = 0; i < 64; i++)
64 C c = x[i].a.m1 (x[i].c);
65 foo (d.bar (), c.bar ());