aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1993-09-24 19:38:20 +0000
committerDoug Evans <dje@gnu.org>1993-09-24 19:38:20 +0000
commit8bc169f258f7643be223c5c94ce89680809a4a76 (patch)
tree80957b8659fd617e686cfdb11670437dbe5b301e
parent6d7096b078685292f6914a35847f4c61b9321df1 (diff)
downloadgcc-8bc169f258f7643be223c5c94ce89680809a4a76.zip
gcc-8bc169f258f7643be223c5c94ce89680809a4a76.tar.gz
gcc-8bc169f258f7643be223c5c94ce89680809a4a76.tar.bz2
cse.c: (FIXED_REGNO_P): HARD_FRAME_POINTER_REGNUM is fixed.
* cse.c: (FIXED_REGNO_P): HARD_FRAME_POINTER_REGNUM is fixed. (CHEAP_REG): HARD_FRAME_POINTER_REGNUM is cheap. (FIXED_BASE_PLUS): Allow hard frame pointer as base. (NONZERO_BASE_PLUS_P): Likewise. (cannon_hash, case REG): Add HARD_FRAME_POINTER_REGNUM to list of special registers for SMALL_REGISTER_CLASSES. (find_best_addr): Addresses containing HARD_FRAME_POINTER_REGNUM cannot be replaced. (cse_main): value in HARD_FRAME_POINTER_REGNUM is preserved across calls. From-SVN: r5451
-rw-r--r--gcc/cse.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index a72e9b9..36d518d 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -440,11 +440,13 @@ struct table_elt
but not if it is an overlapping register. */
#ifdef OVERLAPPING_REGNO_P
#define FIXED_REGNO_P(N) \
- (((N) == FRAME_POINTER_REGNUM || fixed_regs[N]) \
+ (((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \
+ || fixed_regs[N]) \
&& ! OVERLAPPING_REGNO_P ((N)))
#else
#define FIXED_REGNO_P(N) \
- ((N) == FRAME_POINTER_REGNUM || fixed_regs[N])
+ ((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \
+ || fixed_regs[N])
#endif
/* Compute cost of X, as stored in the `cost' field of a table_elt. Fixed
@@ -453,10 +455,10 @@ struct table_elt
a cost of 2. Aside from these special cases, call `rtx_cost'. */
#define CHEAP_REG(N) \
- ((N) == FRAME_POINTER_REGNUM || (N) == STACK_POINTER_REGNUM \
- || (N) == ARG_POINTER_REGNUM \
- || ((N) >= FIRST_VIRTUAL_REGISTER && (N) <= LAST_VIRTUAL_REGISTER) \
- || ((N) < FIRST_PSEUDO_REGISTER \
+ ((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \
+ || (N) == STACK_POINTER_REGNUM || (N) == ARG_POINTER_REGNUM \
+ || ((N) >= FIRST_VIRTUAL_REGISTER && (N) <= LAST_VIRTUAL_REGISTER) \
+ || ((N) < FIRST_PSEUDO_REGISTER \
&& FIXED_REGNO_P (N) && REGNO_REG_CLASS (N) != NO_REGS))
#define COST(X) \
@@ -554,11 +556,13 @@ struct cse_basic_block_data {
by integrate.c, which is called before virtual register instantiation. */
#define FIXED_BASE_PLUS_P(X) \
- ((X) == frame_pointer_rtx || (X) == arg_pointer_rtx \
+ ((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
+ || (X) == arg_pointer_rtx \
|| (X) == virtual_stack_vars_rtx \
|| (X) == virtual_incoming_args_rtx \
|| (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
&& (XEXP (X, 0) == frame_pointer_rtx \
+ || XEXP (X, 0) == hard_frame_pointer_rtx \
|| XEXP (X, 0) == arg_pointer_rtx \
|| XEXP (X, 0) == virtual_stack_vars_rtx \
|| XEXP (X, 0) == virtual_incoming_args_rtx)))
@@ -570,11 +574,12 @@ struct cse_basic_block_data {
the i960, the arg pointer is zero when it is unused. */
#define NONZERO_BASE_PLUS_P(X) \
- ((X) == frame_pointer_rtx \
+ ((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
|| (X) == virtual_stack_vars_rtx \
|| (X) == virtual_incoming_args_rtx \
|| (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
&& (XEXP (X, 0) == frame_pointer_rtx \
+ || XEXP (X, 0) == hard_frame_pointer_rtx \
|| XEXP (X, 0) == arg_pointer_rtx \
|| XEXP (X, 0) == virtual_stack_vars_rtx \
|| XEXP (X, 0) == virtual_incoming_args_rtx)) \
@@ -1839,6 +1844,7 @@ canon_hash (x, mode)
#ifdef SMALL_REGISTER_CLASSES
|| (! fixed_regs[regno]
&& regno != FRAME_POINTER_REGNUM
+ && regno != HARD_FRAME_POINTER_REGNUM
&& regno != ARG_POINTER_REGNUM
&& regno != STACK_POINTER_REGNUM)
#endif
@@ -2510,10 +2516,12 @@ find_best_addr (insn, loc)
&& GET_CODE (XEXP (addr, 0)) == REG
&& GET_CODE (XEXP (addr, 1)) == CONST_INT
&& (regno = REGNO (XEXP (addr, 0)),
- regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM))
+ regno == FRAME_POINTER_REGNUM || regno == HARD_FRAME_POINTER_REGNUM
+ || regno == ARG_POINTER_REGNUM))
|| (GET_CODE (addr) == REG
- && (regno = REGNO (addr),
- regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM))
+ && (regno = REGNO (addr), regno == FRAME_POINTER_REGNUM
+ || regno == HARD_FRAME_POINTER_REGNUM
+ || regno == ARG_POINTER_REGNUM))
|| CONSTANT_ADDRESS_P (addr))
return;
@@ -7805,6 +7813,9 @@ cse_main (f, nregs, after_loop, file)
&& i != STACK_POINTER_REGNUM
&& i != FRAME_POINTER_REGNUM
+#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
+ && i != HARD_FRAME_POINTER_REGNUM
+#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (i == ARG_POINTER_REGNUM && fixed_regs[i])
#endif