(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr92493.c
       1  /* PR middle-end/92493 - ICE in get_origin_and_offset at gimple-ssa-sprintf.c
       2     { dg-do compile }
       3     { dg-options "-O3 -Wall" } */
       4  
       5  struct A
       6  {
       7    int i;
       8    char a[2];
       9  } *p;
      10  
      11  struct B
      12  {
      13    short j;
      14    struct A a;
      15  } b;
      16  
      17  void warn (int j)
      18  {
      19    struct A *q = &b.a;
      20    p = q + j;
      21    __builtin_snprintf (p->a, 8, "%s", p->a);   // { dg-warning "\\\[-Wrestrict" }
      22  }
      23  
      24  void nowarn (char *d, int j)
      25  {
      26    struct A *q = &b.a;
      27    p = q + j;
      28    __builtin_snprintf (d, 8, "%s", p->a);
      29  }