2 /* { dg-do run { target { mmap && ilp32 } } } */
3 /* { dg-options "-Os" } */
7 #define MAP_ANONYMOUS MAP_ANON
58 __attribute__((regparm (3), noinline
)) int
59 fn1 (const char *x
, void *y
, S1
*z
)
61 asm volatile ("" : : : "memory");
65 __attribute__((regparm (3), noinline
)) int
66 fn2 (const char *x
, int y
, S2
*z
)
68 asm volatile ("" : : : "memory");
72 static inline __attribute__ ((always_inline
)) unsigned int
73 fn4 (unsigned short x
)
76 if (len
== ((1 << 16) - 1))
81 static inline __attribute__ ((always_inline
)) S3
*
84 return (S3
*) ((char *) p
+ fn4 (p
->s9
));
87 __attribute__((regparm (3), noinline
)) int
90 asm volatile ("" : : : "memory");
94 static inline __attribute__ ((always_inline
)) int
95 fn6 (S3
*w
, int x
, S2
*y
, S4
*z
)
101 while ((char *) w
< b
+ x
- 2 * sizeof (S4
))
105 fn2 (w
->s12
, w
->s10
, &c
);
108 z
->s13
= (unsigned short) ((char *) w
- b
);
119 __attribute__((regparm (3), noinline
)) unsigned int
120 test (void *u
, S6
*v
, S1
**w
, S7
*x
, S2
*y
, S1
*z
)
122 unsigned b
= v
->s17
->s16
;
127 fn1 (__func__
, u
, x
->s18
);
128 c
= (S4
*) (z
->s3
+ b
);
129 a
= fn6 ((S3
*) (*w
)->s3
, b
, y
, c
);
133 for (i
= a
- 1; ; i
--)
135 if (f
+ (unsigned short) (c
[i
].s14
/ 2) > b
/ 2)
146 char *p
= mmap (NULL
, 131072, PROT_READ
| PROT_WRITE
,
147 MAP_PRIVATE
| MAP_ANONYMOUS
, -1, 0);
156 if (munmap (p
+ 65536, 65536) < 0)
158 memset (&wb
, 0, sizeof (wb
));
159 memset (&z
, 0, sizeof (z
));
160 memset (&v
, 0, sizeof (v
));
161 memset (&x
, 0, sizeof (x
));
162 memset (&y
, 0, sizeof (y
));
163 memset (&vb
, 0, sizeof (vb
));
164 memset (&s4
, 0, sizeof (s4
));
166 z
.s3
= p
+ 65536 - 2 * sizeof (S4
);
169 vb
.s16
= 2 * sizeof (S4
);
170 memcpy (z
.s3
, &s4
, sizeof (s4
));
171 memcpy (z
.s3
+ sizeof (s4
), &s4
, sizeof (s4
));
172 test ((void *) 0, &v
, &w
, &x
, &y
, &z
);