Tue Mar 28 08:29:46 2000 Jan Hubicka <jh@suse.cz>
+ * sibcall.c (indentify_call_return_value): Find last call in the chain;
+ Allow stack adjustment after function call.
+
* regmove.c (struct csa_memlist): Make mem field rtx *.
(record_one_stack_ref): Accept rtx * instead of rtx as parameter.
(try_apply_stack_adjustment): Replace whole MEM rtx.
{
rtx insn, set, hard, soft;
- /* Search forward through the "normal" call sequence to the CALL insn. */
insn = XEXP (cp, 0);
- while (GET_CODE (insn) != CALL_INSN)
+ /* Search backward through the "normal" call sequence to the CALL insn. */
+ while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
+ while (GET_CODE (insn) != CALL_INSN)
+ insn = PREV_INSN (insn);
/* Assume the pattern is (set (dest) (call ...)), or that the first
member of a parallel is. This is the hard return register used
if (GET_CODE (hard) != REG)
return 0;
+ /* Stack adjustment done after call may appear here. */
+ insn = skip_stack_adjustment (insn);
+ if (! insn)
+ return 0;
+
/* If there's nothing after, there's no soft return value. */
insn = NEXT_INSN (insn);
if (! insn)