1 /* PR middle-end/40946 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Wall" } */
8 unsigned short a2, a3, a4, a5, a6, a7;
11 int bar (void *, const char *, int);
12 char *foo (void *, int);
15 baz (const char *x, const char *y)
17 int a = sizeof (struct A) + 2 * (__builtin_strlen (y)
18 + __builtin_strlen (x) + 24) + 16;
19 struct A *b = __builtin_malloc (a);
23 b->a4 = sizeof (struct A);
24 c = ((char *) b) + b->a4;
25 d = ((char *) b) + a - c;
26 b->a2 = b->a3 = (unsigned short) bar (c, y, d); /* { dg-bogus "array subscript is above array bounds" } */
28 d = ((char *) b) + a - c;
29 b->a7 = b->a4 + b->a2;
30 b->a5 = b->a6 = (unsigned short) bar (c, x, d);