1 /* PR tree-optimization/33136 */ 2 /* { dg-do run } */ 3 /* { dg-options "-O2" } */ 4 5 extern void abort (void); 6 7 struct S 8 { 9 struct S *a; 10 int b; 11 float f; 12 }; 13 14 static struct S s; 15 16 static int * 17 __attribute__((noinline, const)) foo(void)18foo (void) 19 { 20 return &s.b; 21 } 22 23 float 24 __attribute__((noinline)) bar(float * f)25bar (float *f) 26 { 27 s.f = 1.0; 28 *f = 4.0; 29 return s.f; 30 } 31 32 int 33 __attribute__((noinline)) baz(int * x)34baz (int *x) 35 { 36 s.b = 1; 37 *x = 4; 38 return s.b; 39 } 40 41 int t(void)42t (void) 43 { 44 float f = 8.0; 45 return bar (&f) + baz (foo ()); 46 } 47 48 int main(void)49main (void) 50 { 51 if (t () != 5) 52 abort (); 53 return 0; 54 } 55