diff options
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/gcc/function.c b/gcc/function.c index 5554cbb..277ac76 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1061,10 +1061,10 @@ find_temp_slot_from_address (rtx x) /* If we have a sum involving a register, see if it points to a temp slot. */ - if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == REG + if (GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && (p = find_temp_slot_from_address (XEXP (x, 0))) != 0) return p; - else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG + else if (GET_CODE (x) == PLUS && REG_P (XEXP (x, 1)) && (p = find_temp_slot_from_address (XEXP (x, 1))) != 0) return p; @@ -1094,7 +1094,7 @@ update_temp_slot_address (rtx old, rtx new) if (GET_CODE (old) != PLUS) return; - if (GET_CODE (new) == REG) + if (REG_P (new)) { update_temp_slot_address (XEXP (old, 0), new); update_temp_slot_address (XEXP (old, 1), new); @@ -1181,7 +1181,7 @@ preserve_temp_slots (rtx x) a temporary slot we know it points to. To be consistent with the code below, we really should preserve all non-kept slots if we can't find a match, but that seems to be much too costly. */ - if (GET_CODE (x) == REG && REG_POINTER (x)) + if (REG_P (x) && REG_POINTER (x)) p = find_temp_slot_from_address (x); /* If X is not in memory or is at a constant address, it cannot be in @@ -1407,7 +1407,7 @@ put_var_into_stack (tree decl, int rescan) if the var is non-local. */ if (TREE_CODE (decl) != SAVE_EXPR && DECL_NONLOCAL (decl) && GET_CODE (reg) == MEM - && GET_CODE (XEXP (reg, 0)) == REG + && REG_P (XEXP (reg, 0)) && REGNO (XEXP (reg, 0)) > LAST_VIRTUAL_REGISTER) { orig_reg = reg = XEXP (reg, 0); @@ -1437,7 +1437,7 @@ put_var_into_stack (tree decl, int rescan) /* Now we should have a value that resides in one or more pseudo regs. */ - if (GET_CODE (reg) == REG) + if (REG_P (reg)) { if (can_use_addressof_p) gen_mem_addressof (reg, decl, rescan); @@ -1761,7 +1761,7 @@ fixup_var_refs_insn (rtx insn, rtx var, enum machine_mode promoted_mode, don't delete the insn. */ && find_reg_note (insn, REG_RETVAL, NULL_RTX) == 0 && (rtx_equal_p (SET_SRC (set), var) - || (GET_CODE (SET_SRC (set)) == REG + || (REG_P (SET_SRC (set)) && (prev = prev_nonnote_insn (insn)) != 0 && (prev_set = single_set (prev)) != 0 && SET_DEST (prev_set) == SET_SRC (set) @@ -1836,7 +1836,7 @@ fixup_var_refs_insn (rtx insn, rtx var, enum machine_mode promoted_mode, { struct fixup_replacement *next; - if (GET_CODE (replacements->new) == REG) + if (REG_P (replacements->new)) { rtx insert_before; rtx seq; @@ -2351,9 +2351,9 @@ fixup_var_refs_1 (rtx var, enum machine_mode promoted_mode, rtx *loc, rtx insn, if ((SET_SRC (x) == var || (GET_CODE (SET_SRC (x)) == SUBREG && SUBREG_REG (SET_SRC (x)) == var)) - && (GET_CODE (SET_DEST (x)) == REG + && (REG_P (SET_DEST (x)) || (GET_CODE (SET_DEST (x)) == SUBREG - && GET_CODE (SUBREG_REG (SET_DEST (x))) == REG)) + && REG_P (SUBREG_REG (SET_DEST (x))))) && GET_MODE (var) == promoted_mode && x == single_set (insn)) { @@ -2422,9 +2422,9 @@ fixup_var_refs_1 (rtx var, enum machine_mode promoted_mode, rtx *loc, rtx insn, if ((SET_DEST (x) == var || (GET_CODE (SET_DEST (x)) == SUBREG && SUBREG_REG (SET_DEST (x)) == var)) - && (GET_CODE (SET_SRC (x)) == REG + && (REG_P (SET_SRC (x)) || (GET_CODE (SET_SRC (x)) == SUBREG - && GET_CODE (SUBREG_REG (SET_SRC (x))) == REG)) + && REG_P (SUBREG_REG (SET_SRC (x))))) && GET_MODE (var) == promoted_mode && x == single_set (insn)) { @@ -2635,7 +2635,7 @@ fixup_stack_1 (rtx x, rtx insn) /* If we have address of a stack slot but it's not valid (displacement is too large), compute the sum in a register. */ if (GET_CODE (ad) == PLUS - && GET_CODE (XEXP (ad, 0)) == REG + && REG_P (XEXP (ad, 0)) && ((REGNO (XEXP (ad, 0)) >= FIRST_VIRTUAL_REGISTER && REGNO (XEXP (ad, 0)) <= LAST_VIRTUAL_REGISTER) || REGNO (XEXP (ad, 0)) == FRAME_POINTER_REGNUM @@ -2717,7 +2717,7 @@ optimize_bit_field (rtx body, rtx insn, rtx *equiv_mem) if (GET_CODE (XEXP (bitfield, 0)) == MEM) memref = XEXP (bitfield, 0); - else if (GET_CODE (XEXP (bitfield, 0)) == REG + else if (REG_P (XEXP (bitfield, 0)) && equiv_mem != 0) memref = equiv_mem[REGNO (XEXP (bitfield, 0))]; else if (GET_CODE (XEXP (bitfield, 0)) == SUBREG @@ -2725,7 +2725,7 @@ optimize_bit_field (rtx body, rtx insn, rtx *equiv_mem) memref = SUBREG_REG (XEXP (bitfield, 0)); else if (GET_CODE (XEXP (bitfield, 0)) == SUBREG && equiv_mem != 0 - && GET_CODE (SUBREG_REG (XEXP (bitfield, 0))) == REG) + && REG_P (SUBREG_REG (XEXP (bitfield, 0)))) memref = equiv_mem[REGNO (SUBREG_REG (XEXP (bitfield, 0)))]; if (memref @@ -2962,7 +2962,7 @@ flush_addressof (tree decl) && DECL_RTL (decl) != 0 && GET_CODE (DECL_RTL (decl)) == MEM && GET_CODE (XEXP (DECL_RTL (decl), 0)) == ADDRESSOF - && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == REG) + && REG_P (XEXP (XEXP (DECL_RTL (decl), 0), 0))) put_addressof_into_stack (XEXP (DECL_RTL (decl), 0), 0); } @@ -2976,7 +2976,7 @@ put_addressof_into_stack (rtx r, htab_t ht) rtx reg = XEXP (r, 0); - if (GET_CODE (reg) != REG) + if (!REG_P (reg)) abort (); decl = ADDRESSOF_DECL (r); @@ -3071,7 +3071,7 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, /* If SUB is a hard or virtual register, try it as a pseudo-register. Otherwise, perhaps SUB is an expression, so generate code to compute it. */ - if (GET_CODE (sub) == REG && REGNO (sub) <= LAST_VIRTUAL_REGISTER) + if (REG_P (sub) && REGNO (sub) <= LAST_VIRTUAL_REGISTER) sub = copy_to_reg (sub); else sub = force_operand (sub, NULL_RTX); @@ -3092,10 +3092,10 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, if (GET_CODE (sub) == MEM) sub = adjust_address_nv (sub, GET_MODE (x), 0); - else if (GET_CODE (sub) == REG + else if (REG_P (sub) && (MEM_VOLATILE_P (x) || GET_MODE (x) == BLKmode)) ; - else if (GET_CODE (sub) == REG && GET_MODE (x) != GET_MODE (sub)) + else if (REG_P (sub) && GET_MODE (x) != GET_MODE (sub)) { int size_x, size_sub; @@ -3133,7 +3133,7 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, rtx z = XEXP (XEXP (tem, 1), 0); if (GET_MODE (x) == GET_MODE (z) - || (GET_CODE (XEXP (XEXP (tem, 1), 0)) != REG + || (!REG_P (XEXP (XEXP (tem, 1), 0)) && GET_CODE (XEXP (XEXP (tem, 1), 0)) != SUBREG)) abort (); @@ -3298,7 +3298,7 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone, { /* Remember the replacement so that the same one can be done on the REG_NOTES. */ - if (GET_CODE (sub) == REG || GET_CODE (sub) == SUBREG) + if (REG_P (sub) || GET_CODE (sub) == SUBREG) { rtx tem; @@ -3385,7 +3385,7 @@ insns_for_mem_walk (rtx *r, void *data) tmp.insns = NULL_RTX; if (ifmwi->pass == 0 && *r && GET_CODE (*r) == ADDRESSOF - && GET_CODE (XEXP (*r, 0)) == REG) + && REG_P (XEXP (*r, 0))) { void **e; tmp.key = XEXP (*r, 0); @@ -3396,7 +3396,7 @@ insns_for_mem_walk (rtx *r, void *data) memcpy (*e, &tmp, sizeof (tmp)); } } - else if (ifmwi->pass == 1 && *r && GET_CODE (*r) == REG) + else if (ifmwi->pass == 1 && *r && REG_P (*r)) { struct insns_for_mem_entry *ifme; tmp.key = *r; @@ -3534,7 +3534,7 @@ purge_single_hard_subreg_set (rtx pattern) enum machine_mode mode = GET_MODE (SET_DEST (pattern)); int offset = 0; - if (GET_CODE (reg) == SUBREG && GET_CODE (SUBREG_REG (reg)) == REG + if (GET_CODE (reg) == SUBREG && REG_P (SUBREG_REG (reg)) && REGNO (SUBREG_REG (reg)) < FIRST_PSEUDO_REGISTER) { offset = subreg_regno_offset (REGNO (SUBREG_REG (reg)), @@ -3545,7 +3545,7 @@ purge_single_hard_subreg_set (rtx pattern) } - if (GET_CODE (reg) == REG && REGNO (reg) < FIRST_PSEUDO_REGISTER) + if (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER) { reg = gen_rtx_REG (mode, REGNO (reg) + offset); SET_DEST (pattern) = reg; @@ -3724,8 +3724,8 @@ instantiate_decl (rtx x, HOST_WIDE_INT size, int valid_only) addr = XEXP (x, 0); if (CONSTANT_P (addr) - || (GET_CODE (addr) == ADDRESSOF && GET_CODE (XEXP (addr, 0)) == REG) - || (GET_CODE (addr) == REG + || (GET_CODE (addr) == ADDRESSOF && REG_P (XEXP (addr, 0))) + || (REG_P (addr) && (REGNO (addr) < FIRST_VIRTUAL_REGISTER || REGNO (addr) > LAST_VIRTUAL_REGISTER))) return; @@ -3883,14 +3883,14 @@ instantiate_virtual_regs_1 (rtx *loc, rtx object, int extra_insns) /* The only valid sources here are PLUS or REG. Just do the simplest possible thing to handle them. */ - if (GET_CODE (src) != REG && GET_CODE (src) != PLUS) + if (!REG_P (src) && GET_CODE (src) != PLUS) { instantiate_virtual_regs_lossage (object); return 1; } start_sequence (); - if (GET_CODE (src) != REG) + if (!REG_P (src)) temp = force_operand (src, NULL_RTX); else temp = src; @@ -3956,7 +3956,7 @@ instantiate_virtual_regs_1 (rtx *loc, rtx object, int extra_insns) /* We know the second operand is a constant. Unless the first operand is a REG (which has been already checked), it needs to be checked. */ - if (GET_CODE (XEXP (x, 0)) != REG) + if (!REG_P (XEXP (x, 0))) { loc = &XEXP (x, 0); goto restart; @@ -4145,7 +4145,7 @@ instantiate_virtual_regs_1 (rtx *loc, rtx object, int extra_insns) if ((GET_CODE (XEXP (x, 0)) == MEM && instantiate_virtual_regs_1 (&XEXP (XEXP (x, 0), 0), XEXP (x, 0), 0)) - || (GET_CODE (XEXP (x, 0)) == REG + || (REG_P (XEXP (x, 0)) && instantiate_virtual_regs_1 (&XEXP (x, 0), object, 0))) return 1; @@ -4179,7 +4179,7 @@ instantiate_virtual_regs_1 (rtx *loc, rtx object, int extra_insns) return 1; case ADDRESSOF: - if (GET_CODE (XEXP (x, 0)) == REG) + if (REG_P (XEXP (x, 0))) return 1; else if (GET_CODE (XEXP (x, 0)) == MEM) @@ -4273,7 +4273,7 @@ aggregate_value_p (tree exp, tree fntype) /* If we have something other than a REG (e.g. a PARALLEL), then assume it is OK. */ - if (GET_CODE (reg) != REG) + if (!REG_P (reg)) return 0; regno = REGNO (reg); @@ -4711,7 +4711,7 @@ assign_parms (tree fndecl) for (i = 0; i < len; i++) if (XEXP (XVECEXP (entry_parm, 0, i), 0) != NULL_RTX - && GET_CODE (XEXP (XVECEXP (entry_parm, 0, i), 0)) == REG + && REG_P (XEXP (XVECEXP (entry_parm, 0, i), 0)) && (GET_MODE (XEXP (XVECEXP (entry_parm, 0, i), 0)) == passed_mode) && INTVAL (XEXP (XVECEXP (entry_parm, 0, i), 1)) == 0) @@ -4781,7 +4781,7 @@ assign_parms (tree fndecl) /* If a BLKmode arrives in registers, copy it to a stack slot. Handle calls that pass values in multiple non-contiguous locations. The Irix 6 ABI has examples of this. */ - if (GET_CODE (entry_parm) == REG + if (REG_P (entry_parm) || (GET_CODE (entry_parm) == PARALLEL && (!loaded_in_reg || !optimize))) { @@ -4947,7 +4947,7 @@ assign_parms (tree fndecl) if (GET_CODE (tempreg) == SUBREG && GET_MODE (tempreg) == nominal_mode - && GET_CODE (SUBREG_REG (tempreg)) == REG + && REG_P (SUBREG_REG (tempreg)) && nominal_mode == passed_mode && GET_MODE (SUBREG_REG (tempreg)) == GET_MODE (entry_parm) && GET_MODE_SIZE (GET_MODE (tempreg)) @@ -5433,7 +5433,7 @@ promoted_input_arg (unsigned int regno, enum machine_mode *pmode, int *punsigned for (arg = DECL_ARGUMENTS (current_function_decl); arg; arg = TREE_CHAIN (arg)) - if (GET_CODE (DECL_INCOMING_RTL (arg)) == REG + if (REG_P (DECL_INCOMING_RTL (arg)) && REGNO (DECL_INCOMING_RTL (arg)) == regno && TYPE_MODE (DECL_ARG_TYPE (arg)) == TYPE_MODE (TREE_TYPE (arg))) { @@ -5708,7 +5708,7 @@ setjmp_vars_warning (tree block) { if (TREE_CODE (decl) == VAR_DECL && DECL_RTL_SET_P (decl) - && GET_CODE (DECL_RTL (decl)) == REG + && REG_P (DECL_RTL (decl)) && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl)))) warning ("%Jvariable '%D' might be clobbered by `longjmp' or `vfork'", decl, decl); @@ -5728,7 +5728,7 @@ setjmp_args_warning (void) for (decl = DECL_ARGUMENTS (current_function_decl); decl; decl = TREE_CHAIN (decl)) if (DECL_RTL (decl) != 0 - && GET_CODE (DECL_RTL (decl)) == REG + && REG_P (DECL_RTL (decl)) && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl)))) warning ("%Jargument '%D' might be clobbered by `longjmp' or `vfork'", decl, decl); @@ -5745,7 +5745,7 @@ setjmp_protect (tree block) if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL) && DECL_RTL (decl) != 0 - && (GET_CODE (DECL_RTL (decl)) == REG + && (REG_P (DECL_RTL (decl)) || (GET_CODE (DECL_RTL (decl)) == MEM && GET_CODE (XEXP (DECL_RTL (decl), 0)) == ADDRESSOF)) /* If this variable came from an inline function, it must be @@ -5778,7 +5778,7 @@ setjmp_protect_args (void) if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL) && DECL_RTL (decl) != 0 - && (GET_CODE (DECL_RTL (decl)) == REG + && (REG_P (DECL_RTL (decl)) || (GET_CODE (DECL_RTL (decl)) == MEM && GET_CODE (XEXP (DECL_RTL (decl), 0)) == ADDRESSOF)) && ( @@ -5815,7 +5815,7 @@ fix_lexical_addr (rtx addr, tree var) addr = XEXP (XEXP (addr, 0), 0); /* Decode given address as base reg plus displacement. */ - if (GET_CODE (addr) == REG) + if (REG_P (addr)) basereg = addr, displacement = 0; else if (GET_CODE (addr) == PLUS && GET_CODE (XEXP (addr, 1)) == CONST_INT) basereg = XEXP (addr, 0), displacement = INTVAL (XEXP (addr, 1)); @@ -6592,7 +6592,7 @@ diddle_return_value (void (*doit) (rtx, void *), void *arg) if (! outgoing) return; - if (GET_CODE (outgoing) == REG) + if (REG_P (outgoing)) (*doit) (outgoing, arg); else if (GET_CODE (outgoing) == PARALLEL) { @@ -6602,7 +6602,7 @@ diddle_return_value (void (*doit) (rtx, void *), void *arg) { rtx x = XEXP (XVECEXP (outgoing, 0, i), 0); - if (GET_CODE (x) == REG && REGNO (x) < FIRST_PSEUDO_REGISTER) + if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER) (*doit) (x, arg); } } @@ -7154,7 +7154,7 @@ keep_stack_depressed (rtx insns) unchanged. Otherwise, it must be a MEM and we see what the base register and offset are. In any case, we have to emit any pending load to the equivalent reg of SP, if any. */ - if (GET_CODE (retaddr) == REG) + if (REG_P (retaddr)) { emit_equiv_load (&info); add_insn (insn); @@ -7162,11 +7162,11 @@ keep_stack_depressed (rtx insns) continue; } else if (GET_CODE (retaddr) == MEM - && GET_CODE (XEXP (retaddr, 0)) == REG) + && REG_P (XEXP (retaddr, 0))) base = gen_rtx_REG (Pmode, REGNO (XEXP (retaddr, 0))), offset = 0; else if (GET_CODE (retaddr) == MEM && GET_CODE (XEXP (retaddr, 0)) == PLUS - && GET_CODE (XEXP (XEXP (retaddr, 0), 0)) == REG + && REG_P (XEXP (XEXP (retaddr, 0), 0)) && GET_CODE (XEXP (XEXP (retaddr, 0), 1)) == CONST_INT) { base = gen_rtx_REG (Pmode, REGNO (XEXP (XEXP (retaddr, 0), 0))); @@ -7291,7 +7291,7 @@ handle_epilogue_set (rtx set, struct epi_info *p) p->new_sp_equiv_reg = XEXP (SET_SRC (set), 0); if (GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT) p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1)); - else if (GET_CODE (XEXP (SET_SRC (set), 1)) == REG + else if (REG_P (XEXP (SET_SRC (set), 1)) && REGNO (XEXP (SET_SRC (set), 1)) < FIRST_PSEUDO_REGISTER && p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))] != 0) p->new_sp_offset @@ -7309,7 +7309,7 @@ handle_epilogue_set (rtx set, struct epi_info *p) p->new_sp_offset += p->sp_offset; } - if (p->new_sp_equiv_reg == 0 || GET_CODE (p->new_sp_equiv_reg) != REG) + if (p->new_sp_equiv_reg == 0 || !REG_P (p->new_sp_equiv_reg)) abort (); return; @@ -7326,8 +7326,8 @@ handle_epilogue_set (rtx set, struct epi_info *p) else if (p->new_sp_equiv_reg != 0 && reg_set_p (p->new_sp_equiv_reg, set)) { if (p->equiv_reg_src != 0 - || GET_CODE (p->new_sp_equiv_reg) != REG - || GET_CODE (SET_DEST (set)) != REG + || !REG_P (p->new_sp_equiv_reg) + || !REG_P (SET_DEST (set)) || GET_MODE_BITSIZE (GET_MODE (SET_DEST (set))) > BITS_PER_WORD || REGNO (p->new_sp_equiv_reg) != REGNO (SET_DEST (set))) abort (); @@ -7360,7 +7360,7 @@ update_epilogue_consts (rtx dest, rtx x, void *data) struct epi_info *p = (struct epi_info *) data; rtx new; - if (GET_CODE (dest) != REG || REGNO (dest) >= FIRST_PSEUDO_REGISTER) + if (!REG_P (dest) || REGNO (dest) >= FIRST_PSEUDO_REGISTER) return; /* If we are either clobbering a register or doing a partial set, @@ -7375,7 +7375,7 @@ update_epilogue_consts (rtx dest, rtx x, void *data) /* If this is a binary operation between a register we have been tracking and a constant, see if we can compute a new constant value. */ else if (ARITHMETIC_P (SET_SRC (x)) - && GET_CODE (XEXP (SET_SRC (x), 0)) == REG + && REG_P (XEXP (SET_SRC (x), 0)) && REGNO (XEXP (SET_SRC (x), 0)) < FIRST_PSEUDO_REGISTER && p->const_equiv[REGNO (XEXP (SET_SRC (x), 0))] != 0 && GET_CODE (XEXP (SET_SRC (x), 1)) == CONST_INT |