[Bug tree-optimization/118947] Missed optimization: GCC forgets stack buffer contents across function call
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 20 23:13:24 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118947
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|rtl-optimization |tree-optimization
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh optimize_memcpy_to_memset does not understand "" either. I will add that
support too.
Here is a testcase to show the vdef issue and not related to the "" issue:
```
void* aaa();
void* bbb()
{
aaa();
static int buf2[32];
int buf[32] = {};
__builtin_memcpy(buf2, buf, sizeof(buf2));
return buf2;
}
void* ccc()
{
int buf[32] = {};
aaa();
static int buf2[32];
__builtin_memcpy(buf2, buf, sizeof(buf2));
return buf2;
}
```
More information about the Gcc-bugs
mailing list