Debian Codegraph @

gcc/testsuite/gcc.dg/Wstringop-overflow-83.c

raw
1 /* PR middle-end/103143 - ICE due to infinite recursion in pointer-query.cc
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
4
5 typedef __SIZE_TYPE__ size_t;
6
7 void foo (size_t x)
8 {
9 struct T { char buf[64]; char buf2[64]; } t;
10 char *p = &t.buf[8];
11 char *r = t.buf2;
12 size_t i;
13
14 for (i = 0; i < x; i++)
15 {
16 r = __builtin_mempcpy (r, p, i);
17 p = r + 1;
18 }
19 }