This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix ICE on function [not] returning variable size


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]