libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-37.c
blob57d218a4fc6750400fd364fb95f20c7576861e45
1 /* PR tree-optimization/88800 - Spurious -Werror=array-bounds for non-taken
2 branch
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 extern void* memmove (void*, const void*, __SIZE_TYPE__);
8 struct A
10 const char *s;
11 int n;
14 void f (void*);
16 struct B
18 char d[5];
19 int n;
22 __attribute__ ((always_inline)) inline void
23 g (struct B *p, struct A a)
25 int i = a.n;
26 if (i <= 5)
27 p->n = i;
28 else {
29 p->n = -1;
30 f (p);
33 if (p->n >= 0)
34 memmove (p->d, a.s, a.n); /* { dg-bogus "\\\[-Warray-bounds" } */
37 void h (void)
39 char c[8] = "";
41 struct A a;
42 a.s = c;
43 a.n = 8;
45 struct B b;
46 g (&b, a);