| 1 |
/* PR ipa/109303 */ |
| 2 |
/* { dg-do compile { target lp64 } } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
|
| 5 |
struct __attribute__((packed)) A { char c1; short a1[__INT_MAX__]; }; |
| 6 |
struct __attribute__((packed)) B { char c2; short a2[100]; }; |
| 7 |
struct S { struct A p1; struct B p2[4]; }; |
| 8 |
void bar (short int); |
| 9 |
|
| 10 |
static void |
| 11 |
foo (struct S *q) |
| 12 |
{ |
| 13 |
for (int i = 0; i < q->p1.c1; i++) |
| 14 |
for (int j = 0; j < q->p2[i].c2; j++) |
| 15 |
bar (q->p2[i].a2[j]); |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
main () |
| 20 |
{ |
| 21 |
struct S q = {}; |
| 22 |
q.p2[0].c2 = q.p2[1].c2 = 3; |
| 23 |
foo (&q); |
| 24 |
} |