https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99504
Bug ID: 99504
Summary: Missing memmove detection
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: crazylht at gmail dot com
CC: hjl.tools at gmail dot com
Target Milestone: ---
Host: x86_64-pc-linux-gnu
cat test.c
typedef struct
{
unsigned char r,g,b,c;
}pixel;
void
foo_memmov (pixel* p, pixel* q, int n)
{
for (int i = 0; i != n; i++)
*p++ = *q++;
}
void
foo_int (int* p, int* q, int n)
{
for (int i = 0; i != n; i++)
*p++ = *q++;
}
gcc -Ofast -march=skylake
https://godbolt.org/z/hbnTfM
1. Not memmov optimization
2. Why didn't vectorizer optimize foo_memmov like foo_int did.