summaryrefslogtreecommitdiff
path: root/gcc/sibcall.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-28 21:03:37 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-28 21:03:37 +0000
commit6aae6e10ad921dbe4d034777dd9f37043e23bea3 (patch)
treed6b867a5f1ff4a5ed3b5ea9ff0b96e65058ce239 /gcc/sibcall.c
parent978879396647b294672004cd572e196634bb7411 (diff)
downloadgcc-6aae6e10ad921dbe4d034777dd9f37043e23bea3.tar.gz
* sibcall.c (indentify_call_return_value): Find last call in the chain;
Allow stack adjustment after function call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32791 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sibcall.c')
-rw-r--r--gcc/sibcall.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/sibcall.c b/gcc/sibcall.c
index 1a3a310388d..34cf5a93348 100644
--- a/gcc/sibcall.c
+++ b/gcc/sibcall.c
@@ -53,10 +53,12 @@ identify_call_return_value (cp, p_hard_return, p_soft_return)
{
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
@@ -75,6 +77,11 @@ identify_call_return_value (cp, p_hard_return, p_soft_return)
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)