1 /* PR tree-optimization/53366 */ 2 /* { dg-do run } */ 3 4 extern void abort (void); 5 6 struct T { float r[3], i[3]; }; 7 struct U { struct T j[4]; }; 8 9 void __attribute__ ((noinline)) foo(struct U * __restrict y,const float _Complex * __restrict x)10foo (struct U *__restrict y, const float _Complex *__restrict x) 11 { 12 int i, j; 13 for (j = 0; j < 4; ++j) 14 { 15 float a = __real__ x[j]; 16 float b = __imag__ x[j]; 17 float c = __real__ x[j + 4]; 18 float d = __imag__ x[j + 4]; 19 for (i = 0; i < 3; ++i) 20 { 21 y->j[j].r[i] = y->j[j].r[i] + a + c; 22 y->j[j].i[i] = y->j[j].i[i] + b + d; 23 } 24 } 25 } 26 27 _Complex float x[8]; 28 struct U y; 29 30 int main()31main () 32 { 33 int i, j; 34 for (i = 0; i < 8; ++i) 35 { 36 x[i] = i + 1.0iF * (2 * i); 37 __asm__ volatile (""); 38 } 39 foo (&y, x); 40 for (j = 0; j < 4; ++j) 41 for (i = 0; i < 3; ++i) 42 if (y.j[j].r[i] != __real__ (x[j] + x[j + 4]) 43 || y.j[j].i[i] != __imag__ (x[j] + x[j + 4])) 44 __builtin_abort (); 45 return 0; 46 } 47