This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dynamic FUNCTION_OUTGOING_VALUE?
Hi Jim, and thanks for the informative reply.
> > Is it possible to get FUNCTION_OUTGOING_VALUE to return something else
> > than a fixed value based on the type of the return operand? I'd like to
> > have all functions returning their value into a pseudo-register instead
> > of a fixed hard one.
>
> Using a pseudo for the return value makes no sense. The only way to
> find the value after the function exits is to make sure it is in a known
> fixed location. A pseudo is not a known fixed location.
The trick is my function calls on my target is done this way:
result <- function
i.e. the result of a function is directly put into the destination operand. So
it is not a fixed place, and being obliged to use a fixed place with GCC I
get suboptimal code.
> There is also an optimization problem here. A store into a pseudo will
> be deleted as dead if it isn't used, so if you put the return value in a
> pseudo, the optimizer will delete it as dead.
The idea behind is of course to use this value after ;)
Alex.