On Mon, Jun 1, 2015 at 11:08 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Ok. (I wonder if there are any cases where the return value is allocated by >> the callee?) > > Thanks. > > Do you mean in GCC or in programming languages in general or...? In GNAT, we > have something like that: when a function returns an unconstrained type whose > size depends on some discriminants of the type, the caller doesn't know the > size of the return value in advance, so the callee allocates the return value > on the "secondary stack" and effectively returns a pointer to it. Of course > you need a specific machinery to manage this secondary stack. And, needless > to say, this is quite inefficient, so we attempt to reduce its usage: > https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02632.html
Yes, in general in GCC. In this case we could still remove the lhs (not sure if it is worth the trouble or even easy to detect on GIMPLE)? Richard. > -- > Eric Botcazou