https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115606
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >- why return slot opt at the gimple level is target specific? TO answer this question is simple, RSO is only for aggregates that returns in memory. Which happens for Foo for the arm target. While on x86_64, Foo returns in a register (rax). So this is just a misnomer of the issue. The problem is tail call in the middle-end does not handle aggregates that return in memory yet; that is what PR 82705 is about.