https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120549
Bug ID: 120549
Summary: call((struct s1){}) causes two stack locations and a
memcpy followed by a memset
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: middle-end
Assignee: pinskia at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
struct f{ int t[1024];};
void g(struct f);
void h(void)
{
g((struct f){});
}
```
Since we currently prop `{}` into the call, we get an extra memcpy and a stack
location.
As far as I can tell it is not a regression because even doing `f()` (value
initialization) for C++ produces memcpy/memset in GCC 3.4.6 (before ssa).