https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88439

            Bug ID: 88439
           Summary: missing -Wrestrict on memcpy with a variable offset
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Thew -Wrestrict warning doesn't trigger for the following overlapping call to
memcpy even though it seems that it could:

$ cat x.c && gcc -O2 -S -Wall x.c
char a[32][32];

void g (int i, int j)
{
  if (i == j)                                     // typo, should be: i != j
    __builtin_memcpy (a[j], a[i], sizeof a[i]);   // missing -Wrestrict
}

Reply via email to