| 1 |
/* Verify that SRA total scalarization works on records containing arrays. */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O1 -fdump-tree-release_ssa --param sra-max-scalarization-size-Ospeed=32" } */ |
| 4 |
|
| 5 |
extern void abort (void); |
| 6 |
|
| 7 |
struct S |
| 8 |
{ |
| 9 |
char c; |
| 10 |
unsigned short f[2][2]; |
| 11 |
int i; |
| 12 |
unsigned short f3, f4; |
| 13 |
}; |
| 14 |
|
| 15 |
|
| 16 |
int __attribute__ ((noinline)) |
| 17 |
foo (struct S *p) |
| 18 |
{ |
| 19 |
struct S l; |
| 20 |
|
| 21 |
l = *p; |
| 22 |
l.i++; |
| 23 |
l.f[1][0] += 3; |
| 24 |
*p = l; |
| 25 |
} |
| 26 |
|
| 27 |
int |
| 28 |
main (int argc, char **argv) |
| 29 |
{ |
| 30 |
struct S a = {0, { {5, 7}, {9, 11} }, 4, 0, 0}; |
| 31 |
foo (&a); |
| 32 |
if (a.i != 5 || a.f[1][0] != 12) |
| 33 |
abort (); |
| 34 |
return 0; |
| 35 |
} |
| 36 |
|
| 37 |
/* { dg-final { scan-tree-dump-times "l;" 0 "release_ssa" } } */ |