gcc/testsuite/gcc.target/i386/pr80262.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | typedef struct { |
| 5 | int v; |
| 6 | } S1; |
| 7 | S1 clearS1 () { S1 s1 = { 0 }; return s1; } |
| 8 | |
| 9 | typedef struct { |
| 10 | S1 s1[4]; |
| 11 | } S2; |
| 12 | void clearS2 (__seg_gs S2* p, int n) { |
| 13 | for (int i = 0; i < n; ++i) |
| 14 | p->s1[i] = clearS1 (); |
| 15 | } |
| 16 | |
| 17 | typedef struct { |
| 18 | int pad; |
| 19 | S2 s2; |
| 20 | } S3; |
| 21 | |
| 22 | long int BASE; |
| 23 | |
| 24 | void fn1(int n) { |
| 25 | clearS2 (&(((__seg_gs S3*)(BASE))->s2), n); |
| 26 | } |