diff options
author | Olivier Hainque <hainque@act-europe.fr> | 2003-05-03 16:25:22 +0200 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2003-05-03 10:25:22 -0400 |
commit | ee9609391b6e1bd4d026b86cf79bced76e1baa5b (patch) | |
tree | 7ad4bd29e44c9c37b87311753f154d5fa72e515b /gcc/emit-rtl.c | |
parent | 3923e4102fcfa593de9148a4855ca54d8466fbe7 (diff) | |
download | gcc-ee9609391b6e1bd4d026b86cf79bced76e1baa5b.zip gcc-ee9609391b6e1bd4d026b86cf79bced76e1baa5b.tar.gz gcc-ee9609391b6e1bd4d026b86cf79bced76e1baa5b.tar.bz2 |
emit-rtl.c (last_call_insn, [...]): New functions.
* emit-rtl.c (last_call_insn, add_function_usage_to): New functions.
* rtl.h (last_call_insn, add_function_usage_to): New prototypes.
* builtins.c (expand_builtin_apply): Use the new emit-rtl functions.
* calls.c (emit_call_1): Likewise.
(expand_call): For calls initializing constant memory, replace
emission of standalone mem /u clobber with function usage entry.
* expr.c (emit_block_move_via_libcall): Likewise.
* cse.c (count_reg_usage, case EXPR_LIST): New case.
* flow.c (propagate_one_insn): Pass entire operand of
CALL_INSN_FUNCTION_USAGE to mark_used_regs.
* integrate.c (try_constants): For CALL_INSNs, substitute constants
within the FUNCTION_USAGE also.
* loop.c (prescan_loop): Note clobbers of const mem mentioned in
FUNCTION_USAGE lists.
* reload1.c (replace_pseudos_in): Renamed.
(reload): Use it for clobbers surviving until the end of the reload.
From-SVN: r66429
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 7048aee..a000551 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3191,6 +3191,22 @@ prev_real_insn (insn) return insn; } +/* Return the last CALL_INSN in the current list, or 0 if there is none. + This routine does not look inside SEQUENCEs. */ + +rtx +last_call_insn () +{ + rtx insn; + + for (insn = get_last_insn (); + insn && GET_CODE (insn) != CALL_INSN; + insn = PREV_INSN (insn)) + ; + + return insn; +} + /* Find the next insn after INSN that really does something. This routine does not look inside SEQUENCEs. Until reload has completed, this is the same as next_real_insn. */ @@ -3850,6 +3866,31 @@ remove_insn (insn) } } +/* Append CALL_FUSAGE to the CALL_INSN_FUNCTION_USAGE for CALL_INSN. */ + +void +add_function_usage_to (call_insn, call_fusage) + rtx call_insn, call_fusage; +{ + if (! call_insn || GET_CODE (call_insn) != CALL_INSN) + abort (); + + /* Put the register usage information on the CALL. If there is already + some usage information, put ours at the end. */ + if (CALL_INSN_FUNCTION_USAGE (call_insn)) + { + rtx link; + + for (link = CALL_INSN_FUNCTION_USAGE (call_insn); XEXP (link, 1) != 0; + link = XEXP (link, 1)) + ; + + XEXP (link, 1) = call_fusage; + } + else + CALL_INSN_FUNCTION_USAGE (call_insn) = call_fusage; +} + /* Delete all insns made since FROM. FROM becomes the new last instruction. */ |