https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105343
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-04-22
Ever confirmed|0 |1
Version|unknown |12.0
Component|c |middle-end
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, on x86-64 I see
<bb 2> :
x = {};
x.s = *s_3(D);
_6 = foobar (&x);
so I suppose this is DSE mem* trimming not working for the x = {}; variant.
There might be already a bug with respect to that.
Indeed gimplification could be smarter and handle the contiguous zeros case
better. I also wonder why it chooses to do the zero pre-init for just two
ints, maybe it gives up for arrays.