Dynamic FUNCTION_OUTGOING_VALUE?
Jim Wilson
wilson@specifixinc.com
Wed Sep 17 18:19:00 GMT 2003
Alexandre Courbot wrote:
> 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.
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.
Internally, gcc will use a pseudo for return values during optimization,
and then copy the pseudo to FUNCTION_OUTGOING_VALUE if it didn't end up
there due to register allocation.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list