https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90204
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- The difference is that for C++ we directly use DECL_RESULT in the GIMPLE IL while for C we end up with a copy to it. The C++ FE does ;; Function v test(v, v) (null) ;; enabled by -tree-original { struct v res [value-expr: <retval>]; and at the end <<cleanup_point return <retval>>>; } while the C FE uses plain res: { struct v res; ... return res; } which in the end also results in try/finally processing for CLOBBERs. Not sure where the C++ FE decides using <retval> for res is fine and whether the C FE could do the same. Certainly eliding this extra copy is beneficial.