[Bug c/98658] New: Loop idiom recognization for memcpy/memmove
david.bolvansky at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 13 13:59:20 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98658
Bug ID: 98658
Summary: Loop idiom recognization for memcpy/memmove
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: david.bolvansky at gmail dot com
Target Milestone: ---
void copy(int *__restrict__ d, int * s, __SIZE_TYPE__ sz) {
__SIZE_TYPE__ i;
for (i = 0; i < sz; i++) {
*d++ = *s++;
}
}
gcc emits call to memcpy.
void copy(int * d, int * s, __SIZE_TYPE__ sz) {
__SIZE_TYPE__ i;
for (i = 0; i < sz; i++) {
*d++ = *s++;
}
}
gcc could emit memmove, but currently does not:
https://godbolt.org/z/5n1rnh
More information about the Gcc-bugs
mailing list