> 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 -- Eric Botcazou