https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91526
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > so the C++ FE already elides the return copy by placing 'result' in the > return slot while the C FE doesn't do this. That's because in C++ the language requires NRV to be performed in certain cases, while for C there is nothing like that and we do the tree NRV in that case only much later (nrv pass). Joseph, any thoughts whether it would be a valid C FE optimization that valid C programs can't observe?