1/* PR tree-optimization/49279 */ 2extern void abort (void); 3 4struct S { int a; int *__restrict p; }; 5 6__attribute__((noinline, noclone)) 7struct S *bar (struct S *p) 8{ 9 struct S *r; 10 asm volatile ("" : "=r" (r) : "0" (p) : "memory"); 11 return r; 12} 13 14__attribute__((noinline, noclone)) 15int 16foo (int *p, int *q) 17{ 18 struct S s, *t; 19 s.a = 1; 20 s.p = p; 21 t = bar (&s); 22 t->p = q; 23 s.p[0] = 0; 24 t->p[0] = 1; 25 return s.p[0]; 26} 27 28int 29main () 30{ 31 int a, b; 32 if (foo (&a, &b) != 1) 33 abort (); 34 return 0; 35} 36