diff options
author | YamaArashi <shadow962@live.com> | 2016-02-15 03:21:26 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-02-15 03:21:26 -0800 |
commit | dae4baf0b704d1b566bbff41774f220b00bf365b (patch) | |
tree | 690def17e9d822f5d62f0d8dbbc266202bce8e01 /gcc | |
parent | ffa585754d6f1cc8eae38ae213b1b1dc6a74d7d3 (diff) |
clean up more reg ifdefs
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/alias.c | 4 | ||||
-rwxr-xr-x | gcc/calls.c | 22 | ||||
-rwxr-xr-x | gcc/combine.c | 98 | ||||
-rwxr-xr-x | gcc/cse.c | 38 | ||||
-rwxr-xr-x | gcc/dwarf2out.c | 22 | ||||
-rwxr-xr-x | gcc/emit-rtl.c | 22 | ||||
-rwxr-xr-x | gcc/except.c | 2 | ||||
-rwxr-xr-x | gcc/explow.c | 6 | ||||
-rwxr-xr-x | gcc/expr.c | 90 | ||||
-rwxr-xr-x | gcc/flow.c | 24 | ||||
-rwxr-xr-x | gcc/function.c | 21 | ||||
-rwxr-xr-x | gcc/gcse.c | 11 | ||||
-rwxr-xr-x | gcc/jump.c | 97 | ||||
-rwxr-xr-x | gcc/local-alloc.c | 9 | ||||
-rwxr-xr-x | gcc/loop.c | 2 | ||||
-rwxr-xr-x | gcc/regclass.c | 8 | ||||
-rwxr-xr-x | gcc/reload.c | 192 | ||||
-rwxr-xr-x | gcc/reload1.c | 222 | ||||
-rwxr-xr-x | gcc/resource.c | 12 | ||||
-rwxr-xr-x | gcc/rtl.h | 28 | ||||
-rwxr-xr-x | gcc/rtlanal.c | 5 | ||||
-rwxr-xr-x | gcc/stmt.c | 18 | ||||
-rwxr-xr-x | gcc/stupid.c | 12 |
23 files changed, 52 insertions, 913 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 6fc54cb..ac966a6 100755 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1427,10 +1427,6 @@ init_alias_analysis () = gen_rtx_ADDRESS (Pmode, arg_pointer_rtx); new_reg_base_value[FRAME_POINTER_REGNUM] = gen_rtx_ADDRESS (Pmode, frame_pointer_rtx); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - new_reg_base_value[HARD_FRAME_POINTER_REGNUM] - = gen_rtx_ADDRESS (Pmode, hard_frame_pointer_rtx); -#endif if (struct_value_incoming_rtx && GET_CODE (struct_value_incoming_rtx) == REG) new_reg_base_value[REGNO (struct_value_incoming_rtx)] diff --git a/gcc/calls.c b/gcc/calls.c index 4f2c148..463f11a 100755 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -39,13 +39,6 @@ Boston, MA 02111-1307, USA. */ They should if the stack and args grow in opposite directions, but only if we have push insns. */ -#ifdef PUSH_ROUNDING - -#if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD) -#define PUSH_ARGS_REVERSED /* If it's last to first */ -#endif - -#endif /* Like PREFERRED_STACK_BOUNDARY but in units of bytes, not bits. */ #define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT) @@ -892,11 +885,7 @@ expand_call (exp, target, ignore) So the entire argument block must then be preallocated (i.e., we ignore PUSH_ROUNDING in that case). */ -#ifdef PUSH_ROUNDING - int must_preallocate = 0; -#else int must_preallocate = 1; -#endif /* Size of the stack reserved for parameter registers. */ int reg_parm_stack_space = 0; @@ -1007,10 +996,6 @@ expand_call (exp, target, ignore) #endif #endif -#if defined(PUSH_ROUNDING) && ! defined(OUTGOING_REG_PARM_STACK_SPACE) - if (reg_parm_stack_space > 0) - must_preallocate = 1; -#endif /* Warn if this value is an aggregate type, regardless of which calling convention we are using for it. */ @@ -2551,10 +2536,8 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode, argblock = virtual_outgoing_args_rtx; #else /* not ACCUMULATE_OUTGOING_ARGS */ -#ifndef PUSH_ROUNDING argblock = push_block (GEN_INT (args_size.constant), 0, 0); #endif -#endif #ifdef PUSH_ARGS_REVERSED #ifdef PREFERRED_STACK_BOUNDARY @@ -3104,10 +3087,8 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, argblock = virtual_outgoing_args_rtx; #else /* not ACCUMULATE_OUTGOING_ARGS */ -#ifndef PUSH_ROUNDING argblock = push_block (GEN_INT (args_size.constant), 0, 0); #endif -#endif #ifdef PUSH_ARGS_REVERSED #ifdef PREFERRED_STACK_BOUNDARY @@ -3637,9 +3618,6 @@ store_one_arg (arg, argblock, may_be_alloca, variable_size, /* Compute how much space the push instruction will push. On many machines, pushing a byte will advance the stack pointer by a halfword. */ -#ifdef PUSH_ROUNDING - size = PUSH_ROUNDING (size); -#endif used = size; /* Compute how much space the argument should get: diff --git a/gcc/combine.c b/gcc/combine.c index 86f41bd..ef05782 100755 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1283,13 +1283,8 @@ combinable_i3pat (i3, loc, i2dest, i1dest, i1_not_in_src, pi3dest_killed) if (pi3dest_killed && GET_CODE (dest) == REG && reg_referenced_p (dest, PATTERN (i3)) && REGNO (dest) != FRAME_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && REGNO (dest) != HARD_FRAME_POINTER_REGNUM -#endif -#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM && (REGNO (dest) != ARG_POINTER_REGNUM || ! fixed_regs [REGNO (dest)]) -#endif && REGNO (dest) != STACK_POINTER_REGNUM) { if (*pi3dest_killed) @@ -3626,12 +3621,7 @@ simplify_rtx (x, op0_mode, last, in_dest) if (GET_CODE (SUBREG_REG (x)) == REG && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER && REGNO (SUBREG_REG (x)) != FRAME_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && REGNO (SUBREG_REG (x)) != HARD_FRAME_POINTER_REGNUM -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && REGNO (SUBREG_REG (x)) != ARG_POINTER_REGNUM -#endif && REGNO (SUBREG_REG (x)) != STACK_POINTER_REGNUM) { if (HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (x)) + SUBREG_WORD (x), @@ -4845,10 +4835,6 @@ simplify_set (x) / UNITS_PER_WORD) == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (src))) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)) -#ifndef WORD_REGISTER_OPERATIONS - && (GET_MODE_SIZE (GET_MODE (src)) - < GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))) -#endif #ifdef CLASS_CANNOT_CHANGE_SIZE && ! (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER && (TEST_HARD_REG_BIT @@ -7543,24 +7529,6 @@ nonzero_bits (x, mode) just return the mode mask. Those tests will then be false. */ return nonzero; -#ifndef WORD_REGISTER_OPERATIONS - /* If MODE is wider than X, but both are a single word for both the host - and target machines, we can compute this from which bits of the - object might be nonzero in its own mode, taking into account the fact - that on many CISC machines, accessing an object in a wider mode - causes the high-order bits to become undefined. So they are - not known to be zero. */ - - if (GET_MODE (x) != VOIDmode && GET_MODE (x) != mode - && GET_MODE_BITSIZE (GET_MODE (x)) <= BITS_PER_WORD - && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT - && GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (GET_MODE (x))) - { - nonzero &= nonzero_bits (x, GET_MODE (x)); - nonzero |= GET_MODE_MASK (mode) & ~ GET_MODE_MASK (GET_MODE (x)); - return nonzero; - } -#endif code = GET_CODE (x); switch (code) @@ -7587,7 +7555,6 @@ nonzero_bits (x, mode) if ((x == frame_pointer_rtx || x == stack_pointer_rtx - || x == hard_frame_pointer_rtx || (REGNO (x) >= FIRST_VIRTUAL_REGISTER && REGNO (x) <= LAST_VIRTUAL_REGISTER)) #ifdef STACK_BIAS @@ -7597,10 +7564,6 @@ nonzero_bits (x, mode) { int sp_alignment = STACK_BOUNDARY / BITS_PER_UNIT; -#ifdef PUSH_ROUNDING - if (REGNO (x) == STACK_POINTER_REGNUM) - sp_alignment = MIN (PUSH_ROUNDING (1), sp_alignment); -#endif /* We must return here, otherwise we may get a worse result from one of the choices below. There is nothing useful below as @@ -7852,7 +7815,7 @@ nonzero_bits (x, mode) { nonzero &= nonzero_bits (SUBREG_REG (x), mode); -#if defined (WORD_REGISTER_OPERATIONS) && defined (LOAD_EXTEND_OP) +#if defined (LOAD_EXTEND_OP) /* If this is a typical RISC machine, we only have to worry about the way loads are extended. */ if (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND @@ -7974,12 +7937,6 @@ num_sign_bit_copies (x, mode) if (GET_MODE (x) != VOIDmode && bitwidth > GET_MODE_BITSIZE (GET_MODE (x))) { -#ifndef WORD_REGISTER_OPERATIONS - /* If this machine does not do all register operations on the entire - register and MODE is wider than the mode of X, we can say nothing - at all about the high-order bits. */ - return 1; -#else /* Likewise on machines that do, if the mode of the object is smaller than a word and loads of that size don't sign extend, we can say nothing about the high order bits. */ @@ -7989,7 +7946,6 @@ num_sign_bit_copies (x, mode) #endif ) return 1; -#endif } switch (code) @@ -8055,7 +8011,6 @@ num_sign_bit_copies (x, mode) - bitwidth))); } -#ifdef WORD_REGISTER_OPERATIONS #ifdef LOAD_EXTEND_OP /* For paradoxical SUBREGs on machines where all register operations affect the entire register, just look inside. Note that we are @@ -8072,7 +8027,6 @@ num_sign_bit_copies (x, mode) && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND) return num_sign_bit_copies (SUBREG_REG (x), mode); #endif -#endif break; case SIGN_EXTRACT: @@ -9551,33 +9505,6 @@ simplify_comparison (code, pop0, pop1) /* Try a few ways of applying the same transformation to both operands. */ while (1) { -#ifndef WORD_REGISTER_OPERATIONS - /* The test below this one won't handle SIGN_EXTENDs on these machines, - so check specially. */ - if (code != GTU && code != GEU && code != LTU && code != LEU - && GET_CODE (op0) == ASHIFTRT && GET_CODE (op1) == ASHIFTRT - && GET_CODE (XEXP (op0, 0)) == ASHIFT - && GET_CODE (XEXP (op1, 0)) == ASHIFT - && GET_CODE (XEXP (XEXP (op0, 0), 0)) == SUBREG - && GET_CODE (XEXP (XEXP (op1, 0), 0)) == SUBREG - && (GET_MODE (SUBREG_REG (XEXP (XEXP (op0, 0), 0))) - == GET_MODE (SUBREG_REG (XEXP (XEXP (op1, 0), 0)))) - && GET_CODE (XEXP (op0, 1)) == CONST_INT - && GET_CODE (XEXP (op1, 1)) == CONST_INT - && GET_CODE (XEXP (XEXP (op0, 0), 1)) == CONST_INT - && GET_CODE (XEXP (XEXP (op1, 0), 1)) == CONST_INT - && INTVAL (XEXP (op0, 1)) == INTVAL (XEXP (op1, 1)) - && INTVAL (XEXP (op0, 1)) == INTVAL (XEXP (XEXP (op0, 0), 1)) - && INTVAL (XEXP (op0, 1)) == INTVAL (XEXP (XEXP (op1, 0), 1)) - && (INTVAL (XEXP (op0, 1)) - == (GET_MODE_BITSIZE (GET_MODE (op0)) - - (GET_MODE_BITSIZE - (GET_MODE (SUBREG_REG (XEXP (XEXP (op0, 0), 0)))))))) - { - op0 = SUBREG_REG (XEXP (XEXP (op0, 0), 0)); - op1 = SUBREG_REG (XEXP (XEXP (op1, 0), 0)); - } -#endif /* If both operands are the same constant shift, see if we can ignore the shift. We can if the shift is a rotate or if the bits shifted out of @@ -10323,20 +10250,8 @@ simplify_comparison (code, pop0, pop1) if (GET_CODE (XEXP (op0, 0)) == SUBREG && ((mode_width >= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0))))) -#ifdef WORD_REGISTER_OPERATIONS || subreg_lowpart_p (XEXP (op0, 0)) -#endif ) -#ifndef WORD_REGISTER_OPERATIONS - /* It is unsafe to commute the AND into the SUBREG if the SUBREG - is paradoxical and WORD_REGISTER_OPERATIONS is not defined. - As originally written the upper bits have a defined value - due to the AND operation. However, if we commute the AND - inside the SUBREG then they no longer have defined values - and the meaning of the code has been changed. */ - && (GET_MODE_SIZE (GET_MODE (XEXP (op0, 0))) - <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0))))) -#endif && GET_CODE (XEXP (op0, 1)) == CONST_INT && mode_width <= HOST_BITS_PER_WIDE_INT && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0)))) @@ -11010,12 +10925,6 @@ use_crosses_set_p (x, from_cuid) int endreg = regno + (regno < FIRST_PSEUDO_REGISTER ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); -#ifdef PUSH_ROUNDING - /* Don't allow uses of the stack pointer to be moved, - because we don't know whether the move crosses a push insn. */ - if (regno == STACK_POINTER_REGNUM) - return 1; -#endif for (;regno < endreg; regno++) if (reg_last_set[regno] && INSN_CUID (reg_last_set[regno]) > from_cuid) @@ -11182,12 +11091,7 @@ mark_used_regs_combine (x) { /* None of this applies to the stack, frame or arg pointers */ if (regno == STACK_POINTER_REGNUM -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - || regno == HARD_FRAME_POINTER_REGNUM -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif || regno == FRAME_POINTER_REGNUM) return; @@ -453,18 +453,9 @@ struct table_elt /* Determine whether register number N is considered a fixed register for CSE. It is desirable to replace other regs with fixed regs, to reduce need for non-fixed hard regs. - A reg wins if it is either the frame pointer or designated as fixed, - but not if it is an overlapping register. */ -#ifdef OVERLAPPING_REGNO_P + A reg wins if it is either the frame pointer or designated as fixed. */ #define FIXED_REGNO_P(N) \ - (((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \ - || fixed_regs[N] || global_regs[N]) \ - && ! OVERLAPPING_REGNO_P ((N))) -#else -#define FIXED_REGNO_P(N) \ - ((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \ - || fixed_regs[N] || global_regs[N]) -#endif + ((N) == FRAME_POINTER_REGNUM || fixed_regs[N] || global_regs[N]) /* Compute cost of X, as stored in the `cost' field of a table_elt. Fixed hard registers and pointers into the frame are the cheapest with a cost @@ -472,7 +463,7 @@ struct table_elt a cost of 2. Aside from these special cases, call `rtx_cost'. */ #define CHEAP_REGNO(N) \ - ((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \ + ((N) == FRAME_POINTER_REGNUM \ || (N) == STACK_POINTER_REGNUM || (N) == ARG_POINTER_REGNUM \ || ((N) >= FIRST_VIRTUAL_REGISTER && (N) <= LAST_VIRTUAL_REGISTER) \ || ((N) < FIRST_PSEUDO_REGISTER \ @@ -569,13 +560,12 @@ 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) == hard_frame_pointer_rtx \ + ((X) == 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)) \ @@ -588,12 +578,11 @@ 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) == hard_frame_pointer_rtx \ + ((X) == 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)) \ @@ -1997,7 +1986,6 @@ canon_hash (x, mode) || (SMALL_REGISTER_CLASSES && ! fixed_regs[regno] && regno != FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM && regno != ARG_POINTER_REGNUM && regno != STACK_POINTER_REGNUM))) { @@ -2707,11 +2695,10 @@ 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 == HARD_FRAME_POINTER_REGNUM + regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM)) || (GET_CODE (addr) == REG && (regno = REGNO (addr), regno == FRAME_POINTER_REGNUM - || regno == HARD_FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM)) || GET_CODE (addr) == ADDRESSOF || CONSTANT_ADDRESS_P (addr)) @@ -7253,14 +7240,6 @@ cse_insn (insn, libcall_insn) if (GET_CODE (dest) == MEM) { -#ifdef PUSH_ROUNDING - /* Stack pushes invalidate the stack pointer. */ - rtx addr = XEXP (dest, 0); - if ((GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC - || GET_CODE (addr) == POST_DEC || GET_CODE (addr) == POST_INC) - && XEXP (addr, 0) == stack_pointer_rtx) - invalidate (stack_pointer_rtx, Pmode); -#endif dest = fold_rtx (dest, insn); } @@ -8624,12 +8603,7 @@ 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 ) || global_regs[i]) SET_HARD_REG_BIT (regs_invalidated_by_call, i); diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4a01bb6..21404e1 100755 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -517,7 +517,7 @@ static void dwarf2out_stack_adjust PROTO((rtx)); rtx expand_builtin_dwarf_fp_regnum () { - return GEN_INT (DWARF_FRAME_REGNUM (HARD_FRAME_POINTER_REGNUM)); + return GEN_INT (DWARF_FRAME_REGNUM (FRAME_POINTER_REGNUM)); } /* The offset from the incoming value of %sp to the top of the stack frame @@ -1257,7 +1257,7 @@ dwarf2out_frame_debug (insn) abort (); if (REGNO (dest) != STACK_POINTER_REGNUM && !(frame_pointer_needed - && REGNO (dest) == HARD_FRAME_POINTER_REGNUM)) + && REGNO (dest) == FRAME_POINTER_REGNUM)) abort (); cfa_reg = REGNO (dest); break; @@ -1281,10 +1281,10 @@ dwarf2out_frame_debug (insn) abort (); } - if (XEXP (src, 0) == hard_frame_pointer_rtx) + if (XEXP (src, 0) == frame_pointer_rtx) { /* Restoring SP from FP in the epilogue. */ - if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM) + if (cfa_reg != (unsigned) FRAME_POINTER_REGNUM) abort (); cfa_reg = STACK_POINTER_REGNUM; } @@ -1298,12 +1298,12 @@ dwarf2out_frame_debug (insn) if (cfa_store_reg == STACK_POINTER_REGNUM) cfa_store_offset += offset; } - else if (dest == hard_frame_pointer_rtx) + else if (dest == frame_pointer_rtx) { /* Either setting the FP from an offset of the SP, or adjusting the FP */ if (! frame_pointer_needed - || REGNO (dest) != HARD_FRAME_POINTER_REGNUM) + || REGNO (dest) != FRAME_POINTER_REGNUM) abort (); if (XEXP (src, 0) == stack_pointer_rtx @@ -1315,12 +1315,12 @@ dwarf2out_frame_debug (insn) if (GET_CODE (src) == PLUS) offset = -offset; cfa_offset += offset; - cfa_reg = HARD_FRAME_POINTER_REGNUM; + cfa_reg = FRAME_POINTER_REGNUM; } - else if (XEXP (src, 0) == hard_frame_pointer_rtx + else if (XEXP (src, 0) == frame_pointer_rtx && GET_CODE (XEXP (src, 1)) == CONST_INT) { - if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM) + if (cfa_reg != (unsigned) FRAME_POINTER_REGNUM) abort (); offset = INTVAL (XEXP (src, 1)); if (GET_CODE (src) == PLUS) @@ -6426,7 +6426,7 @@ based_loc_descr (reg, offset) registers, since the RTL for local variables is relative to one of them. */ register unsigned fp_reg = DBX_REGISTER_NUMBER (frame_pointer_needed - ? HARD_FRAME_POINTER_REGNUM + ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM); if (reg == fp_reg) @@ -8323,7 +8323,7 @@ gen_subprogram_die (decl, context_die) frame pointer or stack pointer registers, since the RTL for local variables is relative to one of them. */ fp_reg - = frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx; + = frame_pointer_needed ? frame_pointer_rtx : stack_pointer_rtx; add_AT_loc (subr_die, DW_AT_frame_base, reg_loc_descriptor (fp_reg)); #if 0 diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 52c28d9..3034a55 100755 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -136,13 +136,6 @@ REAL_VALUE_TYPE dconstm1; But references that were originally to the frame-pointer can be distinguished from the others because they contain frame_pointer_rtx. - When to use frame_pointer_rtx and hard_frame_pointer_rtx is a little - tricky: until register elimination has taken place hard_frame_pointer_rtx - should be used if it is being set, and frame_pointer_rtx otherwise. After - register elimination hard_frame_pointer_rtx should always be used. - On machines where the two registers are same (most) then these are the - same. - In an inline procedure, the stack and frame pointer rtxs may not be used for anything else. */ rtx struct_value_rtx; /* (REG:Pmode STRUCT_VALUE_REGNUM) */ @@ -286,14 +279,8 @@ gen_rtx_REG (mode, regno) { if (regno == FRAME_POINTER_REGNUM) return frame_pointer_rtx; -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - if (regno == HARD_FRAME_POINTER_REGNUM) - return hard_frame_pointer_rtx; -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM if (regno == ARG_POINTER_REGNUM) return arg_pointer_rtx; -#endif #ifdef RETURN_ADDRESS_POINTER_REGNUM if (regno == RETURN_ADDRESS_POINTER_REGNUM) return return_address_pointer_rtx; @@ -3424,7 +3411,6 @@ init_emit () all pointers. */ REGNO_POINTER_FLAG (STACK_POINTER_REGNUM) = 1; REGNO_POINTER_FLAG (FRAME_POINTER_REGNUM) = 1; - REGNO_POINTER_FLAG (HARD_FRAME_POINTER_REGNUM) = 1; REGNO_POINTER_FLAG (ARG_POINTER_REGNUM) = 1; REGNO_POINTER_FLAG (VIRTUAL_INCOMING_ARGS_REGNUM) = 1; @@ -3436,8 +3422,6 @@ init_emit () #ifdef STACK_BOUNDARY REGNO_POINTER_ALIGN (STACK_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT; REGNO_POINTER_ALIGN (FRAME_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT; - REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) - = STACK_BOUNDARY / BITS_PER_UNIT; REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT; REGNO_POINTER_ALIGN (VIRTUAL_INCOMING_ARGS_REGNUM) @@ -3566,14 +3550,8 @@ init_emit_once (line_numbers) PUT_MODE (stack_pointer_rtx, Pmode); REGNO (frame_pointer_rtx) = FRAME_POINTER_REGNUM; PUT_MODE (frame_pointer_rtx, Pmode); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - REGNO (hard_frame_pointer_rtx) = HARD_FRAME_POINTER_REGNUM; - PUT_MODE (hard_frame_pointer_rtx, Pmode); -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM REGNO (arg_pointer_rtx) = ARG_POINTER_REGNUM; PUT_MODE (arg_pointer_rtx, Pmode); -#endif REGNO (virtual_incoming_args_rtx) = VIRTUAL_INCOMING_ARGS_REGNUM; PUT_MODE (virtual_incoming_args_rtx, Pmode); diff --git a/gcc/except.c b/gcc/except.c index 2488d58..ffecaf4 100755 --- a/gcc/except.c +++ b/gcc/except.c @@ -2807,7 +2807,7 @@ expand_eh_return () /* Set the return address to the stub label. */ ra = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, - 0, hard_frame_pointer_rtx); + 0, frame_pointer_rtx); if (GET_CODE (ra) == REG && REGNO (ra) >= FIRST_PSEUDO_REGISTER) abort(); diff --git a/gcc/explow.c b/gcc/explow.c index 9be9e79..e9f32ec 100755 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -399,11 +399,7 @@ copy_all_regs (x) { if (GET_CODE (x) == REG) { - if (REGNO (x) != FRAME_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && REGNO (x) != HARD_FRAME_POINTER_REGNUM -#endif - ) + if (REGNO (x) != FRAME_POINTER_REGNUM) x = copy_to_reg (x); } else if (GET_CODE (x) == MEM) @@ -49,13 +49,6 @@ Boston, MA 02111-1307, USA. */ They should if the stack and args grow in opposite directions, but only if we have push insns. */ -#ifdef PUSH_ROUNDING - -#if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD) -#define PUSH_ARGS_REVERSED /* If it's last to first */ -#endif - -#endif #ifndef STACK_PUSH_CODE #ifdef STACK_GROWS_DOWNWARD @@ -2663,16 +2656,6 @@ emit_move_insn_1 (x, y) { rtx last_insn = 0; -#ifdef PUSH_ROUNDING - - /* If X is a push on the stack, do the push now and replace - X with a reference to the stack pointer. */ - if (push_operand (x, GET_MODE (x))) - { - anti_adjust_stack (GEN_INT (GET_MODE_SIZE (GET_MODE (x)))); - x = change_address (x, VOIDmode, stack_pointer_rtx); - } -#endif /* Show the output dies here. This is necessary for pseudos; hard regs shouldn't appear here except as return values. @@ -2889,56 +2872,6 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, by setting SKIP to 0. */ skip = (reg_parm_stack_space == 0) ? 0 : used; -#ifdef PUSH_ROUNDING - /* Do it with several push insns if that doesn't take lots of insns - and if there is no difficulty with push insns that skip bytes - on the stack for alignment purposes. */ - if (args_addr == 0 - && GET_CODE (size) == CONST_INT - && skip == 0 - && (MOVE_BY_PIECES_P ((unsigned) INTVAL (size) - used, align)) - /* Here we avoid the case of a structure whose weak alignment - forces many pushes of a small amount of data, - and such small pushes do rounding that causes trouble. */ - && ((! SLOW_UNALIGNED_ACCESS) - || align >= BIGGEST_ALIGNMENT / BITS_PER_UNIT - || PUSH_ROUNDING (align) == align) - && PUSH_ROUNDING (INTVAL (size)) == INTVAL (size)) - { - /* Push padding now if padding above and stack grows down, - or if padding below and stack grows up. - But if space already allocated, this has already been done. */ - if (extra && args_addr == 0 - && where_pad != none && where_pad != stack_direction) - anti_adjust_stack (GEN_INT (extra)); - - move_by_pieces (gen_rtx_MEM (BLKmode, gen_push_operand ()), xinner, - INTVAL (size) - used, align); - - if (current_function_check_memory_usage && ! in_check_memory_usage) - { - rtx temp; - - in_check_memory_usage = 1; - temp = get_push_address (INTVAL(size) - used); - if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) - emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, - temp, ptr_mode, - XEXP (xinner, 0), ptr_mode, - GEN_INT (INTVAL(size) - used), - TYPE_MODE (sizetype)); - else - emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, - temp, ptr_mode, - GEN_INT (INTVAL(size) - used), - TYPE_MODE (sizetype), - GEN_INT (MEMORY_USE_RW), - TYPE_MODE (integer_type_node)); - in_check_memory_usage = 0; - } - } - else -#endif /* PUSH_ROUNDING */ { /* Otherwise make space on the stack and copy the data to the address of that space. */ @@ -3143,11 +3076,6 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, && where_pad != none && where_pad != stack_direction) anti_adjust_stack (GEN_INT (extra)); -#ifdef PUSH_ROUNDING - if (args_addr == 0) - addr = gen_push_operand (); - else -#endif { if (GET_CODE (args_so_far) == CONST_INT) addr @@ -4092,7 +4020,6 @@ store_constructor (exp, target, cleared) RTX_UNCHANGING_P (to_rtx) = 1; } -#ifdef WORD_REGISTER_OPERATIONS /* If this initializes a field that is smaller than a word, at the start of a word, try to widen it to a full word. This special case allows us to output C++ member function @@ -4119,7 +4046,6 @@ store_constructor (exp, target, cleared) bitsize = BITS_PER_WORD; mode = word_mode; } -#endif store_constructor_field (to_rtx, bitsize, bitpos, mode, value, type, cleared); } @@ -8410,7 +8336,7 @@ expand_builtin_setjmp (buf_addr, target, first_label, next_label) /* Clobber the FP when we get here, so we have to make sure it's marked as used by this function. */ - emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx)); /* Mark the static chain as clobbered here so life information doesn't get messed up for it. */ @@ -8422,22 +8348,19 @@ expand_builtin_setjmp (buf_addr, target, first_label, next_label) #ifdef HAVE_nonlocal_goto if (! HAVE_nonlocal_goto) #endif - emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx); + emit_move_insn (virtual_stack_vars_rtx, frame_pointer_rtx); -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM if (fixed_regs[ARG_POINTER_REGNUM]) { -#ifdef ELIMINABLE_REGS size_t i; static struct elims {int from, to;} elim_regs[] = ELIMINABLE_REGS; for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++) if (elim_regs[i].from == ARG_POINTER_REGNUM - && elim_regs[i].to == HARD_FRAME_POINTER_REGNUM) + && elim_regs[i].to == FRAME_POINTER_REGNUM) break; if (i == sizeof elim_regs / sizeof elim_regs [0]) -#endif { /* Now restore our arg pointer from the address at which it was saved in our stack frame. @@ -8450,7 +8373,6 @@ expand_builtin_setjmp (buf_addr, target, first_label, next_label) copy_to_reg (arg_pointer_save_area)); } } -#endif #ifdef HAVE_builtin_setjmp_receiver if (HAVE_builtin_setjmp_receiver) @@ -8520,10 +8442,10 @@ expand_builtin_longjmp (buf_addr, value) { lab = copy_to_reg (lab); - emit_move_insn (hard_frame_pointer_rtx, fp); + emit_move_insn (frame_pointer_rtx, fp); emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); - emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx)); emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); emit_indirect_jump (lab); } @@ -9059,7 +8981,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) { rtx tem = expand_builtin_return_addr (DECL_FUNCTION_CODE (fndecl), TREE_INT_CST_LOW (TREE_VALUE (arglist)), - hard_frame_pointer_rtx); + frame_pointer_rtx); /* Some ports cannot access arbitrary stack frames. */ if (tem == NULL) @@ -1352,10 +1352,6 @@ mark_regs_live_at_end (set) of each basic block by reload. */ SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - /* If they are different, also mark the hard frame pointer as live */ - SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM); -#endif /* Mark all global registers and all registers used by the epilogue @@ -2082,15 +2078,10 @@ insn_dead_p (x, needed, call_ok, notes) if ((regno < FIRST_PSEUDO_REGISTER && global_regs[regno]) /* Make sure insns to set frame pointer aren't deleted. */ || regno == FRAME_POINTER_REGNUM -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - || regno == HARD_FRAME_POINTER_REGNUM -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM /* Make sure insns to set arg pointer are never deleted (if the arg pointer isn't fixed, there will be a USE for it, so we can treat it normally). */ || (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif || REGNO_REG_SET_P (needed, regno)) return 0; @@ -2390,12 +2381,7 @@ mark_set_1 (needed, dead, x, insn, significant) if (GET_CODE (reg) == REG && (regno = REGNO (reg), regno != FRAME_POINTER_REGNUM) -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif && ! (regno < FIRST_PSEUDO_REGISTER && global_regs[regno])) /* && regno != STACK_POINTER_REGNUM) -- let's try without this. */ { @@ -2853,12 +2839,7 @@ mark_used_regs (needed, live, x, final, insn) /* For stack ptr or fixed arg pointer, nothing below can be necessary, so waste no more time. */ if (regno == STACK_POINTER_REGNUM -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - || regno == HARD_FRAME_POINTER_REGNUM -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif || regno == FRAME_POINTER_REGNUM) { /* If this is a register we are going to try to eliminate, @@ -3036,12 +3017,7 @@ mark_used_regs (needed, live, x, final, insn) && GET_MODE (testreg) == BLKmode) || (GET_CODE (testreg) == REG && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM) -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif )) /* We used to exclude global_regs here, but that seems wrong. Storing in them is like storing in mem. */ diff --git a/gcc/function.c b/gcc/function.c index cd572ad..4da2f41 100755 --- a/gcc/function.c +++ b/gcc/function.c @@ -2518,9 +2518,6 @@ fixup_stack_1 (x, insn) && ((REGNO (XEXP (ad, 0)) >= FIRST_VIRTUAL_REGISTER && REGNO (XEXP (ad, 0)) <= LAST_VIRTUAL_REGISTER) || REGNO (XEXP (ad, 0)) == FRAME_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || REGNO (XEXP (ad, 0)) == HARD_FRAME_POINTER_REGNUM -#endif || REGNO (XEXP (ad, 0)) == STACK_POINTER_REGNUM || REGNO (XEXP (ad, 0)) == ARG_POINTER_REGNUM || XEXP (ad, 0) == current_function_internal_arg_pointer) @@ -3531,24 +3528,14 @@ instantiate_virtual_regs_1 (loc, object, extra_insns) temp = XEXP (x, 0); if (CONSTANT_ADDRESS_P (temp) -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || temp == arg_pointer_rtx -#endif -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || temp == hard_frame_pointer_rtx -#endif || temp == frame_pointer_rtx) return 1; if (GET_CODE (temp) == PLUS && CONSTANT_ADDRESS_P (XEXP (temp, 1)) && (XEXP (temp, 0) == frame_pointer_rtx -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || XEXP (temp, 0) == hard_frame_pointer_rtx -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || XEXP (temp, 0) == arg_pointer_rtx -#endif )) return 1; @@ -4911,10 +4898,6 @@ locate_and_pad_parm (passed_mode, type, in_regs, fndecl, pad_to_arg_alignment (initial_offset_ptr, boundary); *offset_ptr = *initial_offset_ptr; -#ifdef PUSH_ROUNDING - if (passed_mode != BLKmode) - sizetree = size_int (PUSH_ROUNDING (TREE_INT_CST_LOW (sizetree))); -#endif /* Pad_below needs the pre-rounded size to know how much to pad below so this must be done before rounding up. */ @@ -5935,7 +5918,7 @@ expand_function_start (subr, parms_have_cleanups) fun, Pmode, expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, 0, - hard_frame_pointer_rtx), + frame_pointer_rtx), Pmode); } @@ -6233,7 +6216,7 @@ expand_function_end (filename, line, end_bindings) fun, Pmode, expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, 0, - hard_frame_pointer_rtx), + frame_pointer_rtx), Pmode); } @@ -2224,13 +2224,7 @@ compute_hash_table (set_p) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if ((call_used_regs[regno] && regno != STACK_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM -#endif -#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif - && regno != FRAME_POINTER_REGNUM) || global_regs[regno]) record_last_reg_set_info (insn, regno); @@ -2678,13 +2672,8 @@ compute_kill_rd () { if ((call_used_regs[regno] && regno != STACK_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && regno != HARD_FRAME_POINTER_REGNUM -#endif -#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) -#endif && regno != FRAME_POINTER_REGNUM) || global_regs[regno]) handle_rd_kill_set (insn, regno, bb); @@ -2212,102 +2212,6 @@ delete_noop_moves (f) register rtx body = PATTERN (insn); /* Combine stack_adjusts with following push_insns. */ -#ifdef PUSH_ROUNDING - if (GET_CODE (body) == SET - && SET_DEST (body) == stack_pointer_rtx - && GET_CODE (SET_SRC (body)) == PLUS - && XEXP (SET_SRC (body), 0) == stack_pointer_rtx - && GET_CODE (XEXP (SET_SRC (body), 1)) == CONST_INT - && INTVAL (XEXP (SET_SRC (body), 1)) > 0) - { - rtx p; - rtx stack_adjust_insn = insn; - int stack_adjust_amount = INTVAL (XEXP (SET_SRC (body), 1)); - int total_pushed = 0; - int pushes = 0; - - /* Find all successive push insns. */ - p = insn; - /* Don't convert more than three pushes; - that starts adding too many displaced addresses - and the whole thing starts becoming a losing - proposition. */ - while (pushes < 3) - { - rtx pbody, dest; - p = next_nonnote_insn (p); - if (p == 0 || GET_CODE (p) != INSN) - break; - pbody = PATTERN (p); - if (GET_CODE (pbody) != SET) - break; - dest = SET_DEST (pbody); - /* Allow a no-op move between the adjust and the push. */ - if (GET_CODE (dest) == REG - && GET_CODE (SET_SRC (pbody)) == REG - && REGNO (dest) == REGNO (SET_SRC (pbody))) - continue; - if (! (GET_CODE (dest) == MEM - && GET_CODE (XEXP (dest, 0)) == POST_INC - && XEXP (XEXP (dest, 0), 0) == stack_pointer_rtx)) - break; - pushes++; - if (total_pushed + GET_MODE_SIZE (GET_MODE (SET_DEST (pbody))) - > stack_adjust_amount) - break; - total_pushed += GET_MODE_SIZE (GET_MODE (SET_DEST (pbody))); - } - - /* Discard the amount pushed from the stack adjust; - maybe eliminate it entirely. */ - if (total_pushed >= stack_adjust_amount) - { - delete_computation (stack_adjust_insn); - total_pushed = stack_adjust_amount; - } - else - XEXP (SET_SRC (PATTERN (stack_adjust_insn)), 1) - = GEN_INT (stack_adjust_amount - total_pushed); - - /* Change the appropriate push insns to ordinary stores. */ - p = insn; - while (total_pushed > 0) - { - rtx pbody, dest; - p = next_nonnote_insn (p); - if (GET_CODE (p) != INSN) - break; - pbody = PATTERN (p); - if (GET_CODE (pbody) != SET) - break; - dest = SET_DEST (pbody); - /* Allow a no-op move between the adjust and the push. */ - if (GET_CODE (dest) == REG - && GET_CODE (SET_SRC (pbody)) == REG - && REGNO (dest) == REGNO (SET_SRC (pbody))) - continue; - if (! (GET_CODE (dest) == MEM - && GET_CODE (XEXP (dest, 0)) == POST_INC - && XEXP (XEXP (dest, 0), 0) == stack_pointer_rtx)) - break; - total_pushed -= GET_MODE_SIZE (GET_MODE (SET_DEST (pbody))); - /* If this push doesn't fully fit in the space - of the stack adjust that we deleted, - make another stack adjust here for what we - didn't use up. There should be peepholes - to recognize the resulting sequence of insns. */ - if (total_pushed < 0) - { - emit_insn_before (gen_add2_insn (stack_pointer_rtx, - GEN_INT (- total_pushed)), - p); - break; - } - XEXP (dest, 0) - = plus_constant (stack_pointer_rtx, total_pushed); - } - } -#endif /* Detect and delete no-op move instructions resulting from not allocating a parameter in a register. */ @@ -4695,7 +4599,6 @@ thread_jumps (f, max_reg, flag_before_loop) if (call_used_regs[i] && ! fixed_regs[i] && i != STACK_POINTER_REGNUM && i != FRAME_POINTER_REGNUM - && i != HARD_FRAME_POINTER_REGNUM && i != ARG_POINTER_REGNUM) modified_regs[i] = 1; } diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index fcaf982..25daa98 100755 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1914,17 +1914,8 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested, to another hard reg. It can move only regs made by global-alloc. This is true of any register that can be eliminated. */ -#ifdef ELIMINABLE_REGS for (i = 0; i < (int)(sizeof eliminables / sizeof eliminables[0]); i++) SET_HARD_REG_BIT (used, eliminables[i].from); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - /* If FRAME_POINTER_REGNUM is not a real register, then protect the one - that it might be eliminated into. */ - SET_HARD_REG_BIT (used, HARD_FRAME_POINTER_REGNUM); -#endif -#else - SET_HARD_REG_BIT (used, FRAME_POINTER_REGNUM); -#endif #ifdef CLASS_CANNOT_CHANGE_SIZE if (qty_changes_size[qty]) @@ -3197,7 +3197,7 @@ invariant_p (x) /* We used to check RTX_UNCHANGING_P (x) here, but that is invalid since the reg might be set by initialization within the loop. */ - if ((x == frame_pointer_rtx || x == hard_frame_pointer_rtx + if ((x == frame_pointer_rtx || x == arg_pointer_rtx) && ! current_function_has_nonlocal_goto) return 1; diff --git a/gcc/regclass.c b/gcc/regclass.c index 6104997..eab1a98 100755 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -559,13 +559,7 @@ fix_register (name, fixed, call_used) if ((i = decode_reg_name (name)) >= 0) { - if ((i == STACK_POINTER_REGNUM -#ifdef HARD_FRAME_POINTER_REGNUM - || i == HARD_FRAME_POINTER_REGNUM -#else - || i == FRAME_POINTER_REGNUM -#endif - ) + if ((i == STACK_POINTER_REGNUM || i == FRAME_POINTER_REGNUM) && (fixed == 0 || call_used == 0)) { static char* what_option[2][2] = { diff --git a/gcc/reload.c b/gcc/reload.c index 42cfcd5..639b03f 100755 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -237,19 +237,6 @@ struct decomposition HOST_WIDE_INT end; /* Ending offset or register number. */ }; -#ifdef SECONDARY_MEMORY_NEEDED - -/* Save MEMs needed to copy from one class of registers to another. One MEM - is used per mode, but normally only one or two modes are ever used. - - We keep two versions, before and after register elimination. The one - after register elimination is record separately for each operand. This - is done in case the address is not valid to be sure that we separately - reload each. */ - -static rtx secondary_memlocs[NUM_MACHINE_MODES]; -static rtx secondary_memlocs_elim[NUM_MACHINE_MODES][MAX_RECOG_OPERANDS]; -#endif /* The instruction we are doing reloads for; so we can test whether a register dies in it. */ @@ -585,16 +572,6 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, if (s_reload == n_reloads) { -#ifdef SECONDARY_MEMORY_NEEDED - /* If we need a memory location to copy between the two reload regs, - set it up now. Note that we do the input case before making - the reload and the output case after. This is due to the - way reloads are output. */ - - if (in_p && icode == CODE_FOR_nothing - && SECONDARY_MEMORY_NEEDED (class, reload_class, mode)) - get_secondary_mem (x, reload_mode, opnum, type); -#endif /* We need to make a new secondary reload for this register class. */ reload_in[s_reload] = reload_out[s_reload] = 0; @@ -621,11 +598,6 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, n_reloads++; -#ifdef SECONDARY_MEMORY_NEEDED - if (! in_p && icode == CODE_FOR_nothing - && SECONDARY_MEMORY_NEEDED (reload_class, class, mode)) - get_secondary_mem (x, mode, opnum, type); -#endif } *picode = icode; @@ -633,90 +605,6 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, } #endif /* HAVE_SECONDARY_RELOADS */ -#ifdef SECONDARY_MEMORY_NEEDED - -/* Return a memory location that will be used to copy X in mode MODE. - If we haven't already made a location for this mode in this insn, - call find_reloads_address on the location being returned. */ - -rtx -get_secondary_mem (x, mode, opnum, type) - rtx x; - enum machine_mode mode; - int opnum; - enum reload_type type; -{ - rtx loc; - int mem_valid; - - /* By default, if MODE is narrower than a word, widen it to a word. - This is required because most machines that require these memory - locations do not support short load and stores from all registers - (e.g., FP registers). */ - -#ifdef SECONDARY_MEMORY_NEEDED_MODE - mode = SECONDARY_MEMORY_NEEDED_MODE (mode); -#else - if (GET_MODE_BITSIZE (mode) < BITS_PER_WORD) - mode = mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (mode), 0); -#endif - - /* If we already have made a MEM for this operand in MODE, return it. */ - if (secondary_memlocs_elim[(int) mode][opnum] != 0) - return secondary_memlocs_elim[(int) mode][opnum]; - - /* If this is the first time we've tried to get a MEM for this mode, - allocate a new one. `something_changed' in reload will get set - by noticing that the frame size has changed. */ - - if (secondary_memlocs[(int) mode] == 0) - { -#ifdef SECONDARY_MEMORY_NEEDED_RTX - secondary_memlocs[(int) mode] = SECONDARY_MEMORY_NEEDED_RTX (mode); -#else - secondary_memlocs[(int) mode] - = assign_stack_local (mode, GET_MODE_SIZE (mode), 0); -#endif - } - - /* Get a version of the address doing any eliminations needed. If that - didn't give us a new MEM, make a new one if it isn't valid. */ - - loc = eliminate_regs (secondary_memlocs[(int) mode], VOIDmode, NULL_RTX); - mem_valid = strict_memory_address_p (mode, XEXP (loc, 0)); - - if (! mem_valid && loc == secondary_memlocs[(int) mode]) - loc = copy_rtx (loc); - - /* The only time the call below will do anything is if the stack - offset is too large. In that case IND_LEVELS doesn't matter, so we - can just pass a zero. Adjust the type to be the address of the - corresponding object. If the address was valid, save the eliminated - address. If it wasn't valid, we need to make a reload each time, so - don't save it. */ - - if (! mem_valid) - { - type = (type == RELOAD_FOR_INPUT ? RELOAD_FOR_INPUT_ADDRESS - : type == RELOAD_FOR_OUTPUT ? RELOAD_FOR_OUTPUT_ADDRESS - : RELOAD_OTHER); - - find_reloads_address (mode, NULL_PTR, XEXP (loc, 0), &XEXP (loc, 0), - opnum, type, 0, 0); - } - - secondary_memlocs_elim[(int) mode][opnum] = loc; - return loc; -} - -/* Clear any secondary memory locations we've made. */ - -void -clear_secondary_mem () -{ - zero_memory ((char *) secondary_memlocs, sizeof secondary_memlocs); -} -#endif /* SECONDARY_MEMORY_NEEDED */ /* Find the largest class for which every register number plus N is valid in M1 (if in range). Abort if no such class exists. */ @@ -898,13 +786,11 @@ push_reload (in, out, inloc, outloc, class, && INTEGRAL_MODE_P (GET_MODE (SUBREG_REG (in))) && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (in))) != NIL) #endif -#ifdef WORD_REGISTER_OPERATIONS || ((GET_MODE_SIZE (inmode) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (in)))) && ((GET_MODE_SIZE (inmode) - 1) / UNITS_PER_WORD == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) - 1) / UNITS_PER_WORD))) -#endif )) || (GET_CODE (SUBREG_REG (in)) == REG && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER @@ -942,13 +828,6 @@ push_reload (in, out, inloc, outloc, class, in_subreg_loc = inloc; inloc = &SUBREG_REG (in); in = *inloc; -#if ! defined (LOAD_EXTEND_OP) && ! defined (WORD_REGISTER_OPERATIONS) - if (GET_CODE (in) == MEM) - /* This is supposed to happen only for paradoxical subregs made by - combine.c. (SUBREG (MEM)) isn't supposed to occur other ways. */ - if (GET_MODE_SIZE (GET_MODE (in)) > GET_MODE_SIZE (inmode)) - abort (); -#endif inmode = GET_MODE (in); } @@ -1005,13 +884,11 @@ push_reload (in, out, inloc, outloc, class, || GET_CODE (SUBREG_REG (out)) == MEM) && ((GET_MODE_SIZE (outmode) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (out)))) -#ifdef WORD_REGISTER_OPERATIONS || ((GET_MODE_SIZE (outmode) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (out)))) && ((GET_MODE_SIZE (outmode) - 1) / UNITS_PER_WORD == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - 1) / UNITS_PER_WORD))) -#endif )) || (GET_CODE (SUBREG_REG (out)) == REG && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER @@ -1046,11 +923,6 @@ push_reload (in, out, inloc, outloc, class, out_subreg_loc = outloc; outloc = &SUBREG_REG (out); out = *outloc; -#if ! defined (LOAD_EXTEND_OP) && ! defined (WORD_REGISTER_OPERATIONS) - if (GET_CODE (out) == MEM - && GET_MODE_SIZE (GET_MODE (out)) > GET_MODE_SIZE (outmode)) - abort (); -#endif outmode = GET_MODE (out); } @@ -1269,14 +1141,6 @@ push_reload (in, out, inloc, outloc, class, /* We found no existing reload suitable for re-use. So add an additional reload. */ -#ifdef SECONDARY_MEMORY_NEEDED - /* If a memory location is needed for the copy, make one. */ - if (in != 0 && GET_CODE (in) == REG - && REGNO (in) < FIRST_PSEUDO_REGISTER - && SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (REGNO (in)), - class, inmode)) - get_secondary_mem (in, inmode, opnum, type); -#endif i = n_reloads; reload_in[i] = in; @@ -1301,13 +1165,6 @@ push_reload (in, out, inloc, outloc, class, n_reloads++; -#ifdef SECONDARY_MEMORY_NEEDED - if (out != 0 && GET_CODE (out) == REG - && REGNO (out) < FIRST_PSEUDO_REGISTER - && SECONDARY_MEMORY_NEEDED (class, REGNO_REG_CLASS (REGNO (out)), - outmode)) - get_secondary_mem (out, outmode, opnum, type); -#endif } else { @@ -1662,14 +1519,6 @@ combine_reloads () reload_outmode[output_reload])) && reload_inc[i] == 0 && reload_reg_rtx[i] == 0 -#ifdef SECONDARY_MEMORY_NEEDED - /* Don't combine two reloads with different secondary - memory locations. */ - && (secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[i]] == 0 - || secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]] == 0 - || rtx_equal_p (secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[i]], - secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]])) -#endif && (SMALL_REGISTER_CLASSES ? (reload_reg_class[i] == reload_reg_class[output_reload]) : (reg_class_subset_p (reload_reg_class[i], @@ -1717,12 +1566,6 @@ combine_reloads () = reload_secondary_out_icode[output_reload]; } -#ifdef SECONDARY_MEMORY_NEEDED - /* Copy any secondary MEM. */ - if (secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]] != 0) - secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[i]] - = secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]]; -#endif /* If required, minimize the register class. */ if (reg_class_subset_p (reload_reg_class[output_reload], reload_reg_class[i])) @@ -2327,12 +2170,10 @@ immune_p (x, y, ydata) /* Constants and stack slots never overlap. */ if (CONSTANT_P (xdata.base) && (ydata.base == frame_pointer_rtx - || ydata.base == hard_frame_pointer_rtx || ydata.base == stack_pointer_rtx)) return 1; if (CONSTANT_P (ydata.base) && (xdata.base == frame_pointer_rtx - || xdata.base == hard_frame_pointer_rtx || xdata.base == stack_pointer_rtx)) return 1; /* If either base is variable, we don't know anything. */ @@ -2457,12 +2298,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) no_output_reloads = 1; #endif -#ifdef SECONDARY_MEMORY_NEEDED - /* The eliminated forms of any secondary memory locations are per-insn, so - clear them out here. */ - - zero_memory ((char *) secondary_memlocs_elim, sizeof secondary_memlocs_elim); -#endif /* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it is cheap to move between them. If it is not, there may not be an insn @@ -2803,23 +2638,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) || ((GET_CODE (operand) == MEM || (GET_CODE (operand)== REG && REGNO (operand) >= FIRST_PSEUDO_REGISTER)) -#ifndef WORD_REGISTER_OPERATIONS - && (((GET_MODE_BITSIZE (GET_MODE (operand)) - < BIGGEST_ALIGNMENT) - && (GET_MODE_SIZE (operand_mode[i]) - > GET_MODE_SIZE (GET_MODE (operand)))) - || (GET_CODE (operand) == MEM && BYTES_BIG_ENDIAN) -#ifdef LOAD_EXTEND_OP - || (GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (operand)) - <= UNITS_PER_WORD) - && (GET_MODE_SIZE (operand_mode[i]) - > GET_MODE_SIZE (GET_MODE (operand))) - && INTEGRAL_MODE_P (GET_MODE (operand)) - && LOAD_EXTEND_OP (GET_MODE (operand)) != NIL) -#endif - ) -#endif ) /* Subreg of a hard reg which can't handle the subreg's mode or which would handle that mode in the wrong number of @@ -4762,12 +4580,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn) else if (GET_CODE (ad) == PLUS && GET_CODE (XEXP (ad, 1)) == CONST_INT && GET_CODE (XEXP (ad, 0)) == PLUS && (XEXP (XEXP (ad, 0), 0) == frame_pointer_rtx -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - || XEXP (XEXP (ad, 0), 0) == hard_frame_pointer_rtx -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || XEXP (XEXP (ad, 0), 0) == arg_pointer_rtx -#endif || XEXP (XEXP (ad, 0), 0) == stack_pointer_rtx) && ! memory_address_p (mode, ad)) { @@ -4787,12 +4600,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn) else if (GET_CODE (ad) == PLUS && GET_CODE (XEXP (ad, 1)) == CONST_INT && GET_CODE (XEXP (ad, 0)) == PLUS && (XEXP (XEXP (ad, 0), 1) == frame_pointer_rtx -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || XEXP (XEXP (ad, 0), 1) == hard_frame_pointer_rtx -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM || XEXP (XEXP (ad, 0), 1) == arg_pointer_rtx -#endif || XEXP (XEXP (ad, 0), 1) == stack_pointer_rtx) && ! memory_address_p (mode, ad)) { diff --git a/gcc/reload1.c b/gcc/reload1.c index 22b13af..dc075a5 100755 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -323,17 +323,7 @@ static struct elim_table_1 { int from; int to; -} reg_eliminate_1[] = - -/* If a set of eliminable registers was specified, define the table from it. - Otherwise, default to the normal case of the frame pointer being - replaced by the stack pointer. */ - -#ifdef ELIMINABLE_REGS - ELIMINABLE_REGS; -#else - {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}; -#endif +} reg_eliminate_1[] = ELIMINABLE_REGS; #define NUM_ELIMINABLE_REGS (sizeof reg_eliminate_1/sizeof reg_eliminate_1[0]) @@ -478,7 +468,7 @@ init_reload () for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) { tem = gen_rtx_PLUS (Pmode, - gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM), + gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM), gen_rtx_REG (Pmode, i)); /* This way, we make sure that reg+reg is an offsettable address. */ tem = plus_constant (tem, 4); @@ -610,10 +600,6 @@ reload (first, global, dumpfile) /* Enable find_equiv_reg to distinguish insns made by reload. */ reload_first_uid = get_max_uid (); -#ifdef SECONDARY_MEMORY_NEEDED - /* Initialize the secondary memory table. */ - clear_secondary_mem (); -#endif /* We don't have a stack slot for any spill reg yet. */ zero_memory ((char *) spill_stack_slot, sizeof spill_stack_slot); @@ -838,10 +824,6 @@ reload (first, global, dumpfile) if (! ep->can_eliminate) spill_hard_reg (ep->from, dumpfile, 1); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - if (frame_pointer_needed) - spill_hard_reg (HARD_FRAME_POINTER_REGNUM, dumpfile, 1); -#endif finish_spills (global, dumpfile); /* From now on, we may need to generate moves differently. We may also @@ -1056,7 +1038,7 @@ reload (first, global, dumpfile) if (! frame_pointer_needed) for (i = 0; i < n_basic_blocks; i++) CLEAR_REGNO_REG_SET (basic_block_live_at_start[i], - HARD_FRAME_POINTER_REGNUM); + FRAME_POINTER_REGNUM); /* Come here (with failure set nonzero) if we can't get enough spill regs and we decide not to abort about it. */ @@ -2802,10 +2784,6 @@ eliminate_regs (x, mem_mode, insn) int size = GET_MODE_SIZE (mem_mode); /* If more bytes than MEM_MODE are pushed, account for them. */ -#ifdef PUSH_ROUNDING - if (ep->to_rtx == stack_pointer_rtx) - size = PUSH_ROUNDING (size); -#endif if (code == PRE_DEC || code == POST_DEC) ep->offset += size; else @@ -2840,30 +2818,7 @@ eliminate_regs (x, mem_mode, insn) && reg_equiv_memory_loc != 0 && reg_equiv_memory_loc[REGNO (SUBREG_REG (x))] != 0) { -#if 0 - new = eliminate_regs (reg_equiv_memory_loc[REGNO (SUBREG_REG (x))], - mem_mode, insn); - - /* If we didn't change anything, we must retain the pseudo. */ - if (new == reg_equiv_memory_loc[REGNO (SUBREG_REG (x))]) - new = SUBREG_REG (x); - else - { - /* In this case, we must show that the pseudo is used in this - insn so that delete_output_reload will do the right thing. */ - if (insn != 0 && GET_CODE (insn) != EXPR_LIST - && GET_CODE (insn) != INSN_LIST) - REG_NOTES (emit_insn_before (gen_rtx_USE (VOIDmode, - SUBREG_REG (x)), - insn)) - = gen_rtx_EXPR_LIST (REG_EQUAL, new, NULL_RTX); - - /* Ensure NEW isn't shared in case we have to reload it. */ - new = copy_rtx (new); - } -#else new = SUBREG_REG (x); -#endif } else new = eliminate_regs (SUBREG_REG (x), mem_mode, insn); @@ -2875,8 +2830,7 @@ eliminate_regs (x, mem_mode, insn) if (GET_CODE (new) == MEM && ((x_size < new_size -#ifdef WORD_REGISTER_OPERATIONS - /* On these machines, combine can create rtl of the form + /* Since THUMB has WORD_REGISTER_OPERATIONS, combine can create rtl of the form (set (subreg:m1 (reg:m2 R) 0) ...) where m1 < m2, and expects something interesting to happen to the entire word. Moreover, it will use the @@ -2884,7 +2838,6 @@ eliminate_regs (x, mem_mode, insn) So if the number of words is the same, preserve the subreg so that push_reloads can see it. */ && ! ((x_size-1)/UNITS_PER_WORD == (new_size-1)/UNITS_PER_WORD) -#endif ) || (x_size == new_size)) ) @@ -2992,7 +2945,7 @@ eliminate_regs (x, mem_mode, insn) for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->to_rtx == SET_DEST (x) - && SET_DEST (x) != hard_frame_pointer_rtx) + && SET_DEST (x) != frame_pointer_rtx) { /* If it is being incremented, adjust the offset. Otherwise, this elimination can't be done. */ @@ -3144,72 +3097,6 @@ eliminate_regs_in_insn (insn, replace) for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from_rtx == SET_DEST (old_set) && ep->can_eliminate) { -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - /* If this is setting the frame pointer register to the - hardware frame pointer register and this is an elimination - that will be done (tested above), this insn is really - adjusting the frame pointer downward to compensate for - the adjustment done before a nonlocal goto. */ - if (ep->from == FRAME_POINTER_REGNUM - && ep->to == HARD_FRAME_POINTER_REGNUM) - { - rtx src = SET_SRC (old_set); - int offset = 0, ok = 0; - rtx prev_insn, prev_set; - - if (src == ep->to_rtx) - offset = 0, ok = 1; - else if (GET_CODE (src) == PLUS - && GET_CODE (XEXP (src, 0)) == CONST_INT - && XEXP (src, 1) == ep->to_rtx) - offset = INTVAL (XEXP (src, 0)), ok = 1; - else if (GET_CODE (src) == PLUS - && GET_CODE (XEXP (src, 1)) == CONST_INT - && XEXP (src, 0) == ep->to_rtx) - offset = INTVAL (XEXP (src, 1)), ok = 1; - else if ((prev_insn = prev_nonnote_insn (insn)) != 0 - && (prev_set = single_set (prev_insn)) != 0 - && rtx_equal_p (SET_DEST (prev_set), src)) - { - src = SET_SRC (prev_set); - if (src == ep->to_rtx) - offset = 0, ok = 1; - else if (GET_CODE (src) == PLUS - && GET_CODE (XEXP (src, 0)) == CONST_INT - && XEXP (src, 1) == ep->to_rtx) - offset = INTVAL (XEXP (src, 0)), ok = 1; - else if (GET_CODE (src) == PLUS - && GET_CODE (XEXP (src, 1)) == CONST_INT - && XEXP (src, 0) == ep->to_rtx) - offset = INTVAL (XEXP (src, 1)), ok = 1; - } - - if (ok) - { - if (replace) - { - rtx src - = plus_constant (ep->to_rtx, offset - ep->offset); - - /* First see if this insn remains valid when we - make the change. If not, keep the INSN_CODE - the same and let reload fit it up. */ - validate_change (insn, &SET_SRC (old_set), src, 1); - validate_change (insn, &SET_DEST (old_set), - ep->to_rtx, 1); - if (! apply_change_group ()) - { - SET_SRC (old_set) = src; - SET_DEST (old_set) = ep->to_rtx; - } - } - - val = 1; - goto done; - } - } -#endif - /* In this case this insn isn't serving a useful purpose. We will delete it in reload_as_needed once we know that this elimination is, in fact, being done. @@ -3397,7 +3284,7 @@ mark_not_eliminable (dest, x) if (GET_CODE (dest) == SUBREG) dest = SUBREG_REG (dest); - if (dest == hard_frame_pointer_rtx) + if (dest == frame_pointer_rtx) return; for (i = 0; i < NUM_ELIMINABLE_REGS; i++) @@ -3421,8 +3308,6 @@ static void verify_initial_elim_offsets () { int t; - -#ifdef ELIMINABLE_REGS struct elim_table *ep; for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) @@ -3431,11 +3316,6 @@ verify_initial_elim_offsets () if (t != ep->initial_offset) abort (); } -#else - INITIAL_FRAME_POINTER_OFFSET (t); - if (t != reg_eliminate[0].initial_offset) - abort (); -#endif } /* Reset all offsets on eliminable registers to their initial values. */ @@ -3444,16 +3324,11 @@ set_initial_elim_offsets () { struct elim_table *ep = reg_eliminate; -#ifdef ELIMINABLE_REGS for (; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) { INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, ep->initial_offset); ep->previous_offset = ep->offset = ep->initial_offset; } -#else - INITIAL_FRAME_POINTER_OFFSET (ep->initial_offset); - ep->previous_offset = ep->offset = ep->initial_offset; -#endif num_not_at_initial_offset = 0; } @@ -3505,17 +3380,11 @@ static void update_eliminables (pset) HARD_REG_SET *pset; { -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - int previous_frame_pointer_needed = frame_pointer_needed; -#endif struct elim_table *ep; for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) - if ((ep->from == HARD_FRAME_POINTER_REGNUM && FRAME_POINTER_REQUIRED) -#ifdef ELIMINABLE_REGS - || ! CAN_ELIMINATE (ep->from, ep->to) -#endif - ) + if ((ep->from == FRAME_POINTER_REGNUM && FRAME_POINTER_REQUIRED) + || ! CAN_ELIMINATE (ep->from, ep->to)) ep->can_eliminate = 0; /* Look for the case where we have discovered that we can't replace @@ -3561,7 +3430,7 @@ update_eliminables (pset) for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) { if (ep->can_eliminate && ep->from == FRAME_POINTER_REGNUM - && ep->to != HARD_FRAME_POINTER_REGNUM) + && ep->to != FRAME_POINTER_REGNUM) frame_pointer_needed = 0; if (! ep->can_eliminate && ep->can_eliminate_previous) @@ -3571,13 +3440,6 @@ update_eliminables (pset) num_eliminable--; } } - -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - /* If we didn't need a frame pointer last time, but we do now, spill - the hard frame pointer. */ - if (frame_pointer_needed && ! previous_frame_pointer_needed) - SET_HARD_REG_BIT (*pset, HARD_FRAME_POINTER_REGNUM); -#endif } /* Initialize the table of registers to eliminate. */ @@ -3585,9 +3447,7 @@ static void init_elim_table () { struct elim_table *ep; -#ifdef ELIMINABLE_REGS struct elim_table_1 *ep1; -#endif if (!reg_eliminate) { @@ -3599,36 +3459,17 @@ init_elim_table () /* Does this function require a frame pointer? */ - frame_pointer_needed = (! flag_omit_frame_pointer -#ifdef EXIT_IGNORE_STACK - /* ?? If EXIT_IGNORE_STACK is set, we will not save - and restore sp for alloca. So we can't eliminate - the frame pointer in that case. At some point, - we should improve this by emitting the - sp-adjusting insns for this case. */ - || (current_function_calls_alloca - && EXIT_IGNORE_STACK) -#endif - || FRAME_POINTER_REQUIRED); + frame_pointer_needed = (! flag_omit_frame_pointer || FRAME_POINTER_REQUIRED); num_eliminable = 0; -#ifdef ELIMINABLE_REGS for (ep = reg_eliminate, ep1 = reg_eliminate_1; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++, ep1++) { ep->from = ep1->from; ep->to = ep1->to; - ep->can_eliminate = ep->can_eliminate_previous - = (CAN_ELIMINATE (ep->from, ep->to) - && ! (ep->to == STACK_POINTER_REGNUM && frame_pointer_needed)); + ep->can_eliminate = ep->can_eliminate_previous = (CAN_ELIMINATE (ep->from, ep->to) && ! (ep->to == STACK_POINTER_REGNUM && frame_pointer_needed)); } -#else - reg_eliminate[0].from = reg_eliminate_1[0].from; - reg_eliminate[0].to = reg_eliminate_1[0].to; - reg_eliminate[0].can_eliminate = reg_eliminate[0].can_eliminate_previous - = ! frame_pointer_needed; -#endif /* Count the number of eliminable registers and build the FROM and TO REG rtx's. Note that code in gen_rtx will cause, e.g., @@ -4291,13 +4132,6 @@ reload_as_needed (live_known) /* In case registers overlap, allow certain insns to invalidate particular hard registers. */ -#ifdef INSN_CLOBBERS_REGNO_P - for (i = 0 ; i < FIRST_PSEUDO_REGISTER; i++) - if (TEST_HARD_REG_BIT (reg_reloaded_valid, i) - && INSN_CLOBBERS_REGNO_P (insn, i)) - CLEAR_HARD_REG_BIT (reg_reloaded_valid, i); -#endif - #ifdef USE_C_ALLOCA alloca (0); #endif @@ -5743,10 +5577,6 @@ choose_reload_regs (chain) last_reg) == NO_REGS) #endif -#ifdef SECONDARY_MEMORY_NEEDED - && ! SECONDARY_MEMORY_NEEDED (last_class, class, - mode) -#endif )) && (reload_nregs[r] == max_group_size @@ -5797,7 +5627,7 @@ choose_reload_regs (chain) && reload_out[r] && ! TEST_HARD_REG_BIT (reg_reloaded_dead, i)) /* Don't clobber the frame pointer. */ - || (i == HARD_FRAME_POINTER_REGNUM + || (i == FRAME_POINTER_REGNUM && reload_out[r]) /* Don't really use the inherited spill reg if we need it wider than we've got it. */ @@ -5933,7 +5763,7 @@ choose_reload_regs (chain) /* If we found an equivalent reg, say no code need be generated to load it, and use it as our reload reg. */ - if (equiv != 0 && regno != HARD_FRAME_POINTER_REGNUM) + if (equiv != 0 && regno != FRAME_POINTER_REGNUM) { int nr = HARD_REGNO_NREGS (regno, reload_mode[r]); int k; @@ -6488,11 +6318,6 @@ emit_reload_insns (chain) mode, oldequiv) != NO_REGS) #endif -#ifdef SECONDARY_MEMORY_NEEDED - || SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (regno), - reload_reg_class[j], - mode) -#endif )) oldequiv = 0; } @@ -7678,27 +7503,6 @@ gen_reload (out, in, opnum, type) REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUIV, in, REG_NOTES (insn)); } -#ifdef SECONDARY_MEMORY_NEEDED - /* If we need a memory location to do the move, do it that way. */ - else if (GET_CODE (in) == REG && REGNO (in) < FIRST_PSEUDO_REGISTER - && GET_CODE (out) == REG && REGNO (out) < FIRST_PSEUDO_REGISTER - && SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (REGNO (in)), - REGNO_REG_CLASS (REGNO (out)), - GET_MODE (out))) - { - /* Get the memory to use and rewrite both registers to its mode. */ - rtx loc = get_secondary_mem (in, GET_MODE (out), opnum, type); - - if (GET_MODE (loc) != GET_MODE (out)) - out = gen_rtx_REG (GET_MODE (loc), REGNO (out)); - - if (GET_MODE (loc) != GET_MODE (in)) - in = gen_rtx_REG (GET_MODE (loc), REGNO (in)); - - gen_reload (loc, in, opnum, type); - gen_reload (out, loc, opnum, type); - } -#endif /* If IN is a simple operand, use gen_move_insn. */ else if (GET_RTX_CLASS (GET_CODE (in)) == 'o' || GET_CODE (in) == SUBREG) diff --git a/gcc/resource.c b/gcc/resource.c index 7d38af2..56ca933 100755 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -309,9 +309,6 @@ mark_referenced_resources (x, res, include_delayed_effects) if (frame_pointer_needed) { SET_HARD_REG_BIT (res->regs, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - SET_HARD_REG_BIT (res->regs, HARD_FRAME_POINTER_REGNUM); -#endif } for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) @@ -937,12 +934,6 @@ mark_target_live_regs (insns, target, res) if (call_used_regs[i] && i != STACK_POINTER_REGNUM && i != FRAME_POINTER_REGNUM && i != ARG_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 ) CLEAR_HARD_REG_BIT (current_live_regs, i); @@ -1093,9 +1084,6 @@ init_resource_info (epilogue_insn) if (frame_pointer_needed) { SET_HARD_REG_BIT (end_of_function_needs.regs, FRAME_POINTER_REGNUM); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM); -#endif #ifdef EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK || current_function_sp_is_unchanging) @@ -1120,35 +1120,7 @@ extern rtx gen_rtx_MEM PROTO((enum machine_mode, rtx)); and without prototypes. */ #define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (HOST_WIDE_INT) (N)) - -/* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg - is used to represent the frame pointer. This is because the - hard frame pointer and the automatic variables are separated by an amount - that cannot be determined until after register allocation. We can assume - that in this case ELIMINABLE_REGS will be defined, one action of which - will be to eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM. */ -#ifndef HARD_FRAME_POINTER_REGNUM -#define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM -#endif - -/* For register elimination to work properly these hard_frame_pointer_rtx, - frame_pointer_rtx, and arg_pointer_rtx must be the same if they refer to - the same register. */ -#if HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM -#define hard_frame_pointer_rtx (&global_rtl.frame_pointer_val) -#else -#define hard_frame_pointer_rtx (&global_rtl.hard_frame_pointer_val) -#endif - -#if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM -#define arg_pointer_rtx (&global_rtl.frame_pointer_val) -#else -#if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM -#define arg_pointer_rtx (&global_rtl.hard_frame_pointer_val) -#else #define arg_pointer_rtx (&global_rtl.arg_pointer_val) -#endif -#endif /* Virtual registers are used during RTL generation to refer to locations into the stack frame when the actual location isn't known until RTL generation diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index b22f99a..0207dd1 100755 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -61,7 +61,6 @@ rtx_unstable_p (x) if (code == REG) return ! (REGNO (x) == FRAME_POINTER_REGNUM - || REGNO (x) == HARD_FRAME_POINTER_REGNUM || REGNO (x) == ARG_POINTER_REGNUM || RTX_UNCHANGING_P (x)); @@ -104,7 +103,7 @@ rtx_varies_p (x) and arg pointers and not just the register number in case we have eliminated the frame and/or arg pointer and are using it for pseudos. */ - return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx + return ! (x == frame_pointer_rtx || x == arg_pointer_rtx); case LO_SUM: @@ -144,7 +143,7 @@ rtx_addr_can_trap_p (x) case REG: /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */ - return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx + return ! (x == frame_pointer_rtx || x == stack_pointer_rtx || x == arg_pointer_rtx); case CONST: @@ -699,7 +699,7 @@ expand_goto (label) to the location of the function's incoming static chain info. The non-local goto handler will then adjust it to contain the proper value and reload the argument pointer, if needed. */ - emit_move_insn (hard_frame_pointer_rtx, lookup_static_chain (label)); + emit_move_insn (frame_pointer_rtx, lookup_static_chain (label)); /* We have now loaded the frame pointer hardware register with the address of that corresponds to the start of the virtual @@ -710,20 +710,20 @@ expand_goto (label) which will do any cleanups and then jump to the label. */ addr = copy_rtx (handler_slot); temp = copy_to_reg (replace_rtx (addr, virtual_stack_vars_rtx, - hard_frame_pointer_rtx)); + frame_pointer_rtx)); /* Restore the stack pointer. Note this uses fp just restored. */ addr = p->nonlocal_goto_stack_level; if (addr) addr = replace_rtx (copy_rtx (addr), virtual_stack_vars_rtx, - hard_frame_pointer_rtx); + frame_pointer_rtx); emit_stack_restore (SAVE_NONLOCAL, addr, NULL_RTX); - /* USE of hard_frame_pointer_rtx added for consistency; not clear if + /* USE of frame_pointer_rtx added for consistency; not clear if really needed. */ - emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx)); emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); emit_indirect_jump (temp); } @@ -3005,12 +3005,10 @@ expand_nl_goto_receiver () the original assignment true. So the following insn will actually be decrementing fp by STARTING_FRAME_OFFSET. */ - emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx); + emit_move_insn (virtual_stack_vars_rtx, frame_pointer_rtx); -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM if (fixed_regs[ARG_POINTER_REGNUM]) { -#ifdef ELIMINABLE_REGS /* If the argument pointer can be eliminated in favor of the frame pointer, we don't need to restore it. We assume here that if such an elimination is present, it can always be used. @@ -3021,11 +3019,10 @@ expand_nl_goto_receiver () for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++) if (elim_regs[i].from == ARG_POINTER_REGNUM - && elim_regs[i].to == HARD_FRAME_POINTER_REGNUM) + && elim_regs[i].to == FRAME_POINTER_REGNUM) break; if (i == sizeof elim_regs / sizeof elim_regs [0]) -#endif { /* Now restore our arg pointer from the address at which it was saved in our stack frame. @@ -3040,7 +3037,6 @@ expand_nl_goto_receiver () copy_to_reg (arg_pointer_save_area)); } } -#endif #ifdef HAVE_nonlocal_goto_receiver if (HAVE_nonlocal_goto_receiver) diff --git a/gcc/stupid.c b/gcc/stupid.c index d912a33..385831d 100755 --- a/gcc/stupid.c +++ b/gcc/stupid.c @@ -500,13 +500,8 @@ stupid_find_reg (call_preserved, class, mode, int changes_size ATTRIBUTE_UNUSED; { register int i, ins; -#ifdef HARD_REG_SET - register /* Declare them register if they are scalars. */ -#endif HARD_REG_SET used, this_reg; -#ifdef ELIMINABLE_REGS static struct {int from, to; } eliminables[] = ELIMINABLE_REGS; -#endif /* If this register's life is more than 5,000 insns, we probably can't allocate it, so don't waste the time trying. This avoids @@ -518,15 +513,8 @@ stupid_find_reg (call_preserved, class, mode, COPY_HARD_REG_SET (used, call_preserved ? call_used_reg_set : fixed_reg_set); -#ifdef ELIMINABLE_REGS for (i = 0; i < (int)(sizeof eliminables / sizeof eliminables[0]); i++) SET_HARD_REG_BIT (used, eliminables[i].from); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - SET_HARD_REG_BIT (used, HARD_FRAME_POINTER_REGNUM); -#endif -#else - SET_HARD_REG_BIT (used, FRAME_POINTER_REGNUM); -#endif for (ins = born_insn; ins < dead_insn; ins++) IOR_HARD_REG_SET (used, after_insn_hard_regs[ins]); |