https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101353
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Keywords| |easyhack, | |missed-optimization Last reconfirmed| |2021-07-06 Status|UNCONFIRMED |NEW Version|unknown |12.0 Ever confirmed|0 |1 Component|c++ |tree-optimization --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- void placement_call () { <bb 2> [local count: 1073741824]: MEM[(struct T *)&buffer] = factory (42); [return slot optimization] return; } Most likely because the gimple level detection of tail calls does not handle RSO based function calls with global data. It should not be hard to add.