1 /* PR middle-end/29272 */ 2 3 extern void abort (void); 4 5 struct S { struct S *s; } s; 6 struct T { struct T *t; } t; 7 8 static inline void foo(void * s)9foo (void *s) 10 { 11 struct T *p = s; 12 __builtin_memcpy (&p->t, &t.t, sizeof (t.t)); 13 } 14 15 void * 16 __attribute__((noinline)) bar(void * p,struct S * q)17bar (void *p, struct S *q) 18 { 19 q->s = &s; 20 foo (p); 21 return q->s; 22 } 23 24 int main(void)25main (void) 26 { 27 t.t = &t; 28 if (bar (&s, &s) != (void *) &t) 29 abort (); 30 return 0; 31 } 32