1 /* PR rtl-optimization/46614 */ 2 /* { dg-do run } */ 3 /* { dg-options "-O -fno-rename-registers -fsched2-use-superblocks -fschedule-insns2 -funroll-loops" } */ 4 /* { dg-require-effective-target scheduling } */ 5 6 extern void abort (void); 7 8 struct S 9 { 10 unsigned char a; 11 unsigned char b; 12 unsigned int c; 13 unsigned int e; 14 unsigned char f; 15 unsigned int g; 16 }; 17 bar(struct S * x)18void bar (struct S *x) 19 { 20 int i; 21 struct S *p = x; 22 struct S r[16]; 23 unsigned j; 24 for (i = 0; i < 16; i++) 25 { 26 r[i].c = p->b + p->c; 27 j = p->c + p->f; 28 r[i].a = j + p->b; 29 r[i].f = p->f + p->e; 30 r[i].g = p->b + p->c; 31 } 32 for (i = 0; i < 16; i++) 33 { 34 if (r[i].c != x[i].b + x[i].c 35 || r[i].a != x[i].c + x[i].f + x[i].b 36 || r[i].f != x[i].f + x[i].e 37 || r[i].g != x[i].b + x[i].c) 38 abort (); 39 } 40 for (i = 0; i < 16; i++) 41 { 42 r[i].b = p->c; 43 if (r[i].b != x[i].c) 44 abort (); 45 } 46 } 47 48 int main()49main () 50 { 51 int i; 52 struct S x[16]; 53 for (i = 0; i < 16; i++) 54 x[i].b = x[i].c = x[i].e = x[i].f = 5; 55 bar (x); 56 return 0; 57 } 58