This is the mail archive of the gcc@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: Dynamic FUNCTION_OUTGOING_VALUE?


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



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