https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112653
Bug ID: 112653
Summary: We should optimize memmove to memcpy using alias
oracle
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: hubicka at gcc dot gnu.org
Target Milestone: ---
In this testcase (losely based on libstdc++ implementation of vectors)
I we should be able to turn memmove to memcpy because we know that the two
parameters can not alias
#include <stdlib.h>
#include <string.h>
char *test;
char *
copy_test ()
{
char *test2 = malloc (1000);
memmove (test2, test, 1000);
return test2;
}