diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-24 09:34:15 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-24 09:34:15 +0000 |
commit | 2e3b0d0fde7879de7ccc1f2f2e76bb8ab4f3743a (patch) | |
tree | 12104592791a836124a5fa50178055b2071db3fd /gcc/calls.c | |
parent | 2cc49064f6255da8ca63b3897ac371fe2fc322cc (diff) | |
download | gcc-2e3b0d0fde7879de7ccc1f2f2e76bb8ab4f3743a.tar.gz |
-fuse-caller-save - Add new reg-note REG_CALL_DECL
2014-04-24 Radovan Obradovic <robradovic@mips.com>
Tom de Vries <tom@codesourcery.com>
* reg-notes.def (REG_NOTE (CALL_DECL)): New reg-note REG_CALL_DECL.
* calls.c (expand_call, emit_library_call_value_1): Add REG_CALL_DECL
reg-note.
* combine.c (distribute_notes): Handle REG_CALL_DECL reg-note.
* emit-rtl.c (try_split): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index f0c92ddc018..e798c7a0349 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -3178,6 +3178,19 @@ expand_call (tree exp, rtx target, int ignore) next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage, flags, args_so_far); + if (flag_use_caller_save) + { + rtx last, datum = NULL_RTX; + if (fndecl != NULL_TREE) + { + datum = XEXP (DECL_RTL (fndecl), 0); + gcc_assert (datum != NULL_RTX + && GET_CODE (datum) == SYMBOL_REF); + } + last = last_call_insn (); + add_reg_note (last, REG_CALL_DECL, datum); + } + /* If the call setup or the call itself overlaps with anything of the argument setup we probably clobbered our call address. In that case we can't do sibcalls. */ @@ -4205,6 +4218,14 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, valreg, old_inhibit_defer_pop + 1, call_fusage, flags, args_so_far); + if (flag_use_caller_save) + { + rtx last, datum = orgfun; + gcc_assert (GET_CODE (datum) == SYMBOL_REF); + last = last_call_insn (); + add_reg_note (last, REG_CALL_DECL, datum); + } + /* Right-shift returned value if necessary. */ if (!pcc_struct_value && TYPE_MODE (tfom) != BLKmode |