1 /* { dg-do run } */ 2 /* { dg-options "-fno-tree-sra" } */ 3 4 extern void abort (void); 5 struct Foo { 6 int *p; 7 } x; 8 struct Foo __attribute__((noinline)) bar(int * p)9bar(int *p) 10 { 11 struct Foo f; 12 f.p = p; 13 return f; 14 } 15 void __attribute__((noinline)) foo()16foo() 17 { 18 *x.p = 0; 19 } main()20int main() 21 { 22 int b; 23 b = 1; 24 struct Foo g = bar (&b); 25 x = g; 26 foo(); 27 if (b != 0) 28 abort (); 29 return 0; 30 } 31