https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83456
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-02-06 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=84095 Ever confirmed|0 |1 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Here's a slightly different test case, this one from bug 84095 comment 14 (reduced from bug 84095 comment 17). I'll confirm this bug based on that one. $ cat t.c && gcc -O2 -S -Wall t.c extern void* memcpy (void*, const void*, __SIZE_TYPE__); char a[4]; void f (unsigned n) { for (int i = 0; i < 1; i++) { if (!i) continue; memcpy (a, a, n); } } t.c: In function ‘f’: t.c:12:7: warning: ‘memcpy’ source argument is the same as destination [-Wrestrict] memcpy (a, a, n); ^~~~~~~~~~~~~~~~