This is the mail archive of the 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]


> Using a pseudo on the other hand makes no sense.  The callee will store
> into a pseudo at the end of the function, and the optimizer will delete
> it as unused.  The caller will look for a value in a different pseudo,
> but nothing will be there, because there is no way for the callee to
> store into a pseudo in the caller.

What I had in mind was that the callee always returns to a fixed place, while 
the callers can get the return value from a pseudo. Since patterns for 
call_value looks typically like

(set (operand 0) (call ....))

I think it would work. FUNCTION_VALUE would return a fixed place, but 
FUNCTION_OUTGOING_VALUE could return a pseudo. That way I could implement my 
function calls with maximum efficiency, i.e. "res <- function" in the 
assembler file. For now I am obliged to use a temporary variable (mapped to 
the fixed place functions returns to), and then copy this variable to the 
result operand.

What prevents me from creating a pseudo in FUNCTION_RETURN_VALUE is that is it 
called several times for every function call, and even when outputting the 
code of the callee. So it is impossible to assign a unique pseudo for every 
function call.


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