1 /* PR tree-optimization/53265 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Wall" } */
4 /* { dg-require-effective-target size32plus } */
15 for (i
= 0; i
< 128; ++i
) /* { dg-message "note: within this loop" } */
16 a
[i
] = i
* 0x02000001; /* { dg-warning "64 invokes undefined behavior" } */
23 unsigned long long a
[128];
26 for (i
= 0; i
< 128; i
++) /* { dg-message "note: within this loop" } */
27 a
[i
] = (i
+ 1LL) * 0x0123456789ABCDEFLL
; /* { dg-warning "112 invokes undefined behavior" } */
34 unsigned char a
[16], b
[16], c
[16];
38 for (i
= 0; i
< (int) (sizeof (a
) / sizeof (a
[0])); i
++) /* { dg-message "note: within this loop" } */
40 c
[i
+ 8] = b
[i
]; /* { dg-warning "8 invokes undefined behavior" } */
41 /* { dg-warning "out of the bounds" "" { target *-*-* } .-1 } */
42 a
[i
+ 8] = b
[i
+ 8]; /* { dg-warning "out of the bounds" } */
51 unsigned int *a
[32], *o
, i
;
54 for (i
= 0; i
<= sizeof (a
) / sizeof (a
[0]); i
++) /* { dg-message "note: within this loop" } */
56 o
= a
[i
]; /* { dg-warning "32 invokes undefined behavior" } */
64 unsigned short a
[23940];
69 for (j
= 0; j
< 1140; j
++) /* { dg-message "note: within this loop" } */
70 a
[23940 + j
- 950] = b
[j
]; /* { dg-warning "950 invokes undefined behavior" } */
77 double a
[4][3], b
[12];
80 for (i
= 0; i
< 12; i
++) /* { dg-message "note: within this loop" } */
81 a
[0][i
] = b
[i
] / 10000.0; /* { dg-warning "3 invokes undefined behavior" } */
90 for (b
= a
[c
= 0]; c
< 16; b
= a
[++c
])
91 /* { dg-warning "15 invokes undefined behavior" "" { target *-*-* } .-1 } */
92 /* { dg-message "note: within this loop" "" { target *-*-* } .-2 } */
97 const void *va
, *vb
, *vc
, *vd
, *ve
;
103 vf
[0] = va
; vf
[1] = vb
; vf
[2] = vc
; vf
[3] = vd
;
104 for (i
= 0; i
< (sizeof (vf
) / sizeof (vf
[0])); i
++)
109 int wa
, wb
[53][5], wc
[53][5];
115 for (i
= 0; i
< 53; i
++)
116 for (j
= 16 / (((wa
& 1) != 0) ? 8 : 4); j
> 0; j
--)
119 if (wb
[i
][j
] == 0 || wc
[i
][1] != 0)
121 for (k
= 0; k
< j
; k
++)
139 for (i
= 16; i
< 32; i
++) /* { dg-message "note: within this loop" } */
140 xa
[i
] = 26; /* { dg-warning "2 invokes undefined behavior" } */
143 __attribute__((noinline
)) static void
150 while (++i
!= x
); /* { dg-bogus "invokes undefined behavior" } */