https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121417
Bug ID: 121417
Summary: Missed copy prop for aggregate with memcpy
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Extracted this testcase from PR 111231 (on arm-linuxeabi) :
```
/*
aD.78519 = D.78618;
vD.78525 = D.78618;
MEM <unsigned charD.27[16]> [(charD.7 * {ref-all})&D.78600] = MEM <unsigned
charD.27[16]> [(charD.7 * {ref-all})&vD.78525];
*/
struct s1
{
unsigned char t[1024];
};
struct s1 f(struct s1 a)
{
struct s1 b = a;
struct s1 c;
__builtin_memcpy (&c, &b, sizeof(c));
return c;
}
```
We should not have 2 memcpy in the final code.