(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
Wstringop-overflow-pr106904.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -Wstringop-overflow -fno-vect-cost-model" } */
       3  
       4  struct windowpos
       5  {
       6    int hwnd;
       7    int hwnd2;
       8  };
       9  
      10  struct packed_windowpos
      11  {
      12    int hwnd;
      13    int pad1;
      14    int hwnd2;
      15    int pad2;
      16  };
      17  
      18  struct packed_structs
      19  {
      20    struct packed_windowpos wp;
      21  };
      22  
      23  void func(struct packed_structs *ps)
      24  {
      25    struct windowpos wp;
      26  
      27    wp.hwnd = ps->wp.hwnd;
      28    wp.hwnd2 = ps->wp.hwnd2;
      29    __builtin_memcpy(&ps->wp, &wp, sizeof(wp)); /* { dg-bogus "into a region" } */
      30  }