diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2004-03-05 10:17:40 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2004-03-05 10:17:40 +0000 |
commit | 86caf04d48093177caa3904e186ef538e4094e9d (patch) | |
tree | e25808a224115fb6cb5f5a75d510945a3104eb09 /gcc/reload1.c | |
parent | d0fe265e2c15a06650afe13d598e4f4b83fd96d6 (diff) | |
download | gcc-86caf04d48093177caa3904e186ef538e4094e9d.zip gcc-86caf04d48093177caa3904e186ef538e4094e9d.tar.gz gcc-86caf04d48093177caa3904e186ef538e4094e9d.tar.bz2 |
cse.c (cse_end_of_basic_block): Make static.
2004-02-18 Paolo Bonzini <bonzini@gnu.org>
* 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
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index 870570c..ce7bf83 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. */ |