From 86caf04d48093177caa3904e186ef538e4094e9d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 5 Mar 2004 10:17:40 +0000 Subject: [PATCH] cse.c (cse_end_of_basic_block): Make static. 2004-02-18 Paolo Bonzini * cse.c (cse_end_of_basic_block): Make static. * local-alloc.c (function_invariant_p): Move to reload1.c. * loop.c (libcall_other_reg, record_excess_regs): Make static. * reload1.c (function_invariant_p): Moved here from local-alloc.c, made static. * rtl.h (cse_end_of_basic_block, function_invariant_p, libcall_other_reg, record_excess_regs): Remove declarations. From-SVN: r78960 --- gcc/ChangeLog | 13 +++++++++++++ gcc/cse.c | 4 +++- gcc/local-alloc.c | 21 --------------------- gcc/loop.c | 6 ++++-- gcc/reload1.c | 22 ++++++++++++++++++++++ 5 files changed, 42 insertions(+), 24 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eaf1236f6492..04774a596f61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2004-03-05 Paolo Bonzini + + * cse.c (cse_end_of_basic_block): Make static. + * local-alloc.c (function_invariant_p): Move to + reload1.c. + * loop.c (libcall_other_reg, record_excess_regs): + Make static. + * reload1.c (function_invariant_p): Moved here + from local-alloc.c, made static. + * rtl.h (cse_end_of_basic_block, function_invariant_p, + libcall_other_reg, record_excess_regs): Remove + declarations. + 2004-03-05 Kazu Hirata * config/m32r/m32r.c (signed_comparison_operator): Add a diff --git a/gcc/cse.c b/gcc/cse.c index 1d3d3a193e91..27732e4c41ff 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -639,6 +639,8 @@ static void record_jump_equiv (rtx, int); static void record_jump_cond (enum rtx_code, enum machine_mode, rtx, rtx, int); static void cse_insn (rtx, rtx); +static void cse_end_of_basic_block (rtx, struct cse_basic_block_data *, + int, int, int); static int addr_affects_sp_p (rtx); static void invalidate_from_clobbers (rtx); static rtx cse_process_notes (rtx, rtx); @@ -6759,7 +6761,7 @@ cse_set_around_loop (rtx x, rtx insn, rtx loop_start) the current block. The incoming structure's branch path, if any, is used to construct the output branch path. */ -void +static void cse_end_of_basic_block (rtx insn, struct cse_basic_block_data *data, int follow_jumps, int after_loop, int skip_blocks) { diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index d71acab4daeb..1802d093a69b 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -759,27 +759,6 @@ memref_used_between_p (rtx memref, rtx start, rtx end) return 0; } -/* Return nonzero if the rtx X is invariant over the current function. */ -/* ??? Actually, the places this is used in reload expect exactly what - is tested here, and not everything that is function invariant. In - particular, the frame pointer and arg pointer are special cased; - pic_offset_table_rtx is not, and this will cause aborts when we - go to spill these things to memory. */ - -int -function_invariant_p (rtx x) -{ - if (CONSTANT_P (x)) - return 1; - if (x == frame_pointer_rtx || x == arg_pointer_rtx) - return 1; - if (GET_CODE (x) == PLUS - && (XEXP (x, 0) == frame_pointer_rtx || XEXP (x, 0) == arg_pointer_rtx) - && CONSTANT_P (XEXP (x, 1))) - return 1; - return 0; -} - /* Find registers that are equivalent to a single value throughout the compilation (either because they can be referenced in memory or are set once from a single constant). Lower their priority for a register. diff --git a/gcc/loop.c b/gcc/loop.c index c4ca250b910f..5d458cbabc8c 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -263,6 +263,8 @@ static void replace_call_address (rtx, rtx, rtx); #endif static rtx skip_consec_insns (rtx, int); static int libcall_benefit (rtx); +static rtx libcall_other_reg (rtx, rtx); +static void record_excess_regs (rtx, rtx, rtx *); static void ignore_some_movables (struct loop_movables *); static void force_movables (struct loop_movables *); static void combine_movables (struct loop_movables *, struct loop_regs *); @@ -1231,7 +1233,7 @@ scan_loop (struct loop *loop, int flags) /* Add elements to *OUTPUT to record all the pseudo-regs mentioned in IN_THIS but not mentioned in NOT_IN_THIS. */ -void +static void record_excess_regs (rtx in_this, rtx not_in_this, rtx *output) { enum rtx_code code; @@ -1285,7 +1287,7 @@ record_excess_regs (rtx in_this, rtx not_in_this, rtx *output) If there are none, return 0. If there are one or more, return an EXPR_LIST containing all of them. */ -rtx +static rtx libcall_other_reg (rtx insn, rtx equiv) { rtx note = find_reg_note (insn, REG_RETVAL, NULL_RTX); diff --git a/gcc/reload1.c b/gcc/reload1.c index 870570c0956d..ce7bf83526e5 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -402,6 +402,7 @@ static int reload_reg_free_for_value_p (int, int, int, enum reload_type, rtx, rtx, int, int); static int free_for_value_p (int, enum machine_mode, int, enum reload_type, rtx, rtx, int, int); +static int function_invariant_p (rtx); static int reload_reg_reaches_end_p (unsigned int, int, enum reload_type); static int allocate_reload_reg (struct insn_chain *, int, int); static int conflicts_with_override (rtx); @@ -4976,6 +4977,27 @@ free_for_value_p (int regno, enum machine_mode mode, int opnum, return 1; } +/* Return nonzero if the rtx X is invariant over the current function. */ +/* ??? Actually, the places where we use this expect exactly what + * is tested here, and not everything that is function invariant. In + * particular, the frame pointer and arg pointer are special cased; + * pic_offset_table_rtx is not, and this will cause aborts when we + * go to spill these things to memory. */ + +static int +function_invariant_p (rtx x) +{ + if (CONSTANT_P (x)) + return 1; + if (x == frame_pointer_rtx || x == arg_pointer_rtx) + return 1; + if (GET_CODE (x) == PLUS + && (XEXP (x, 0) == frame_pointer_rtx || XEXP (x, 0) == arg_pointer_rtx) + && CONSTANT_P (XEXP (x, 1))) + return 1; + return 0; +} + /* Determine whether the reload reg X overlaps any rtx'es used for overriding inheritance. Return nonzero if so. */