summaryrefslogtreecommitdiff
path: root/gcc/sibcall.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-04 18:04:36 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-04 18:04:36 +0000
commit84e81e84adc59d4a0ed070b49f4f888c191acb98 (patch)
tree829c85ccd2ce524faa3bdeb601db3f7f80cc282f /gcc/sibcall.c
parentb14e5da57c59fd64cba5cfc30634a137f0685274 (diff)
downloadgcc-84e81e84adc59d4a0ed070b49f4f888c191acb98.tar.gz
* rtlanal.c (operand_preference): Fix preference for objects.
* gcse.c (handle_avail_expr): Be prepared to handle single_set parallels. * combine.c (if_then_else_cond): Use simplify_subreg instead of operand_subword. * integreate.c (sub_constants): Likewise. * emit-rtl.c (constant_subword): Deprecate; remove most of code and use simplify_gen_subreg. Mon Jun 4 19:55:23 CEST 2001 Lars Brinkhoff <lars@nocrew.org> * sibcall.c (skip_copy_to_return_value): recognize the situation when the called function's return value is copied into an intermediate pseudo, and then into the calling functions return value register. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sibcall.c')
-rw-r--r--gcc/sibcall.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/sibcall.c b/gcc/sibcall.c
index 13f9c1f0069..53ce4317c96 100644
--- a/gcc/sibcall.c
+++ b/gcc/sibcall.c
@@ -169,6 +169,30 @@ skip_copy_to_return_value (orig_insn)
&& SET_SRC (set) == softret)
return insn;
+ /* Recognize the situation when the called function's return value
+ is copied in two steps: first into an intermediate pseudo, then
+ the into the calling functions return value register. */
+
+ if (REG_P (SET_DEST (set))
+ && SET_SRC (set) == softret)
+ {
+ rtx x = SET_DEST (set);
+
+ insn = next_nonnote_insn (insn);
+ if (! insn)
+ return orig_insn;
+
+ set = single_set (insn);
+ if (! set)
+ return orig_insn;
+
+ if (SET_DEST (set) == current_function_return_rtx
+ && REG_P (SET_DEST (set))
+ && OUTGOING_REGNO (REGNO (SET_DEST (set))) == REGNO (hardret)
+ && SET_SRC (set) == x)
+ return insn;
+ }
+
/* It did not look like a copy of the return value, so return the
same insn we were passed. */
return orig_insn;