1 /* PR middle-end/70025 */
3 /* { dg-additional-options "-mtune=z10" { target s390*-*-* } } */
4 /* { dg-require-effective-target int32plus } */
6 typedef char (*F
) (unsigned long, void *);
7 typedef union { struct A
{ char a1
, a2
, a3
, a4
; unsigned long a5
; F a6
; void *a7
; } b
; char c
[1]; } B
;
8 struct C
{ const char *c1
; unsigned long c2
; };
9 typedef struct D
{ unsigned long d1
; int d2
; const char *d3
; unsigned long d4
, d5
; struct C d6
[49]; char d7
[8]; } E
[1];
11 __attribute__ ((noinline
, noclone
))
12 void foo (register E p
)
14 asm volatile ("" : : "r" (p
) : "memory");
17 __attribute__ ((noinline
, noclone
))
18 void bar (register E p
)
20 register unsigned long k
= p
[0].d1
+ 1;
21 register struct C
*l
= &p
[0].d6
[p
[0].d2
];
22 register const char *m
= l
->c1
;
26 register struct A
*f
= &((B
*) m
)->b
;
27 register unsigned long n
= l
->c2
;
28 register unsigned long o
= n
+ f
->a5
;
31 register unsigned long i
;
32 register unsigned long q
= k
+ 8;
33 register F a6
= f
->a6
;
34 register void *a7
= f
->a7
;
37 for (i
= k
; i
< q
; i
++)
38 p
[0].d7
[i
- k
] = (*a6
) (i
- n
, a7
);
45 while (p
[0].d2
> 0 && l
[0].c2
!= l
[-1].c2
)
60 baz (unsigned long i
, void *j
)
72 __builtin_memset (&f
, 0, sizeof (f
));
76 __builtin_memset (&p
, 0, sizeof (p
));
77 p
.d6
[0].c1
= (const char *) &f
;
79 if (p
.d4
!= 1 || p
.d5
!= 9 || p
.d3
!= p
.d7
)
84 /* At -O3 the loop in bar() is vectorized and results in a (possibly
85 unreachable) out-of-bounds store to p.d7[8]:
87 { dg-prune-output "-Wstringop-overflow" } */