]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/Warray-bounds-55.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-55.c
1 /* PR middle-end/92373 - ICE in -Warray-bounds on access to member array
2 in an initialized char buffer
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
5
6 void sink (void*);
7
8 struct S
9 {
10 char data[1];
11 };
12
13 char a[6] = { };
14
15 int f (void)
16 {
17 struct S *p = (struct S*)a;
18 return p->data[4];
19
20 }
21
22 void g (void)
23 {
24 char b[6] = { };
25 struct S *p = (struct S*)b;
26 p->data[4] = 0;
27 sink (p);
28 }