summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr80262.c
blob: f34d06e8c8ad8f6d160f4940cab40d7ed626e067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* { dg-do compile } */
/* { dg-options "-O2" } */

typedef struct {
  int v;
} S1;
S1 clearS1 () { S1 s1 = { 0 }; return s1; }
 
typedef struct {
  S1 s1[4];
} S2;
void clearS2 (__seg_gs S2* p, int n) {
  for (int i = 0; i < n; ++i)
    p->s1[i] = clearS1 ();
}
 
typedef struct {
  int pad;
  S2 s2;
} S3;
 
long int BASE;
 
void fn1(int n) {
  clearS2 (&(((__seg_gs S3*)(BASE))->s2), n);
}