[Bug c++/106151] Inconsistent optimization when defaulting aggregate vs non-aggregate

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 9 19:44:48 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106151

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> Ideally the middle end should optimize it. But until then, I wonder if the
> front end could detect when a non-trivial ctor is just doing zero-init of
> every member, and fold it early.

The front-end suggestion is what is done in GCC 15+.


More information about the Gcc-bugs mailing list