blob: d301300c9031c7ca05f0cc6fee7b09a99615c2ed [file] [log] [blame]
/* PR middle-end/92493 - ICE in get_origin_and_offset at gimple-ssa-sprintf.c
{ dg-do compile }
{ dg-options "-O3 -Wall" } */
struct A
{
int i;
char a[2];
} *p;
struct B
{
short j;
struct A a;
} b;
void warn (int j)
{
struct A *q = &b.a;
p = q + j;
__builtin_snprintf (p->a, 8, "%s", p->a); // { dg-warning "\\\[-Wrestrict" }
}
void nowarn (char *d, int j)
{
struct A *q = &b.a;
p = q + j;
__builtin_snprintf (d, 8, "%s", p->a);
}