1 /* PR middle-end/36902 Array bound warning with dead code after optimization */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Warray-bounds -Wall -Wextra" } */
4 typedef unsigned char __u8
;
5 typedef unsigned short __u16
;
7 static inline unsigned char *
8 foo(unsigned char * to
, const unsigned char * from
, int n
)
24 unsigned char pcr_select
[4];
27 unsigned char buf
[64];
30 sel
.size_of_select
= 3;
31 foo(buf
, sel
.pcr_select
, sel
.size_of_select
);
37 static inline unsigned char *
38 foo2(unsigned char * to
, const unsigned char * from
, int n
)
46 to
[4] = from
[4]; /* { dg-warning "\\\[-Warray-bounds" } */
54 sel
.size_of_select
= 5;
55 foo2(buf
, sel
.pcr_select
, sel
.size_of_select
);