+2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ * hard-reg-set.h (call_used_or_fixed_reg_p): New macro.
+ * cfgloopanal.c (init_set_costs): Use call_used_or_fixed_reg_p
+ instead of testing call_used_regs directly.
+ * config/aarch64/aarch64.c (aarch64_layout_frame): Likewise.
+ (aarch64_components_for_bb): Likewise.
+ * config/alpha/alpha.c (alpha_compute_frame_layout): Likewise.
+ * config/arc/arc.c (arc_must_save_register): Likewise.
+ (arc_epilogue_uses): Likewise.
+ * config/arm/arm.c (arm_option_override, use_return_insn): Likewise.
+ (legitimize_pic_address, callee_saved_reg_p): Likewise.
+ (arm_compute_save_reg0_reg12_mask): Likewise.
+ (arm_compute_save_core_reg_mask): Likewise.
+ (arm_get_vfp_saved_size, arm_compute_frame_layout): Likewise.
+ (arm_save_coproc_regs, thumb1_extra_regs_pushed): Likewise.
+ (cmse_nonsecure_entry_clear_before_return): Likewise.
+ (thumb1_expand_epilogue, arm_expand_epilogue_apcs_frame): Likewise.
+ (arm_expand_epilogue): Likewise.
+ * config/avr/avr.c (avr_regs_to_save, sequent_regs_live): Likewise.
+ (avr_function_arg_advance, avr_find_unused_d_reg): Likewise.
+ (_reg_unused_after): Likewise.
+ * config/bfin/bfin.c (must_save_p, expand_prologue_reg_save): Likewise.
+ (expand_epilogue_reg_restore, n_regs_saved_by_prologue): Likewise.
+ (add_to_reg, hwloop_optimize): Likewise.
+ * config/bpf/bpf.c (bpf_compute_frame_layout, bpf_expand_prologue)
+ (bpf_expand_epilogue): Likewise.
+ * config/c6x/c6x.c (c6x_save_reg, c6x_regno_reg_class): Likewise.
+ * config/cr16/cr16.c (cr16_compute_save_regs): Likewise.
+ * config/cris/cris.c (cris_reg_saved_in_regsave_area): Likewise.
+ * config/epiphany/epiphany.c (epiphany_init_reg_tables): Likewise.
+ (epiphany_compute_function_type, MUST_SAVE_REGISTER): Likewise.
+ (epiphany_output_mi_thunk, epiphany_start_function): Likewise.
+ * config/fr30/fr30.c (fr30_num_arg_regs): Likewise.
+ * config/frv/frv.c (frv_stack_info): Likewise.
+ * config/ft32/ft32.c (ft32_compute_frame): Likewise.
+ (ft32_expand_prologue, ft32_expand_epilogue): Likewise.
+ * config/gcn/gcn.c (gcn_compute_frame_offsets): Likewise.
+ (move_callee_saved_registers): Likewise.
+ * config/h8300/h8300.c (byte_reg): Likewise.
+ * config/i386/i386-options.c (ix86_set_current_function): Likewise.
+ * config/i386/i386.c (ix86_save_reg, ix86_expand_prologue): Likewise.
+ (ix86_expand_epilogue, x86_order_regs_for_local_alloc): Likewise.
+ * config/i386/predicates.md (sibcall_memory_operand): Likewise.
+ * config/ia64/ia64.c (emit_safe_across_calls, find_gr_spill): Likewise.
+ (next_scratch_gr_reg, ia64_compute_frame_size): Likewise.
+ * config/iq2000/iq2000.h (MUST_SAVE_REGISTER): Likewise.
+ * config/lm32/lm32.c (lm32_compute_frame_size): Likewise.
+ * config/m32c/m32c.c (need_to_save): Likewise.
+ * config/m68k/m68k.c (m68k_save_reg): Likewise.
+ * config/mcore/mcore.c (calc_live_regs): Likewise.
+ * config/microblaze/microblaze.c (microblaze_must_save_register):
+ Likewise.
+ * config/mmix/mmix.c (mmix_local_regno): Likewise.
+ (mmix_initial_elimination_offset, mmix_reorg): Likewise.
+ (mmix_use_simple_return, mmix_expand_prologue): Likewise.
+ (mmix_expand_epilogue): Likewise.
+ * config/moxie/moxie.c (moxie_compute_frame): Likewise.
+ (moxie_expand_prologue, moxie_expand_epilogue): Likewise.
+ * config/msp430/msp430.c (msp430_preserve_reg_p): Likewise.
+ * config/nds32/nds32.h (nds32_16bit_address_type): Likewise.
+ (NDS32_REQUIRED_CALLEE_SAVED_P): Likewise.
+ * config/nios2/nios2.c (prologue_saved_reg_p): Likewise.
+ * config/or1k/or1k.c (callee_saved_regno_p): Likewise.
+ * config/pa/pa.c (pa_expand_prologue, pa_expand_epilogue): Likewise.
+ * config/pdp11/pdp11.c (pdp11_saved_regno): Likewise.
+ * config/pru/pru.c (prologue_saved_reg_p): Likewise.
+ * config/riscv/riscv.c (riscv_save_reg_p): Likewise.
+ (riscv_epilogue_uses, riscv_hard_regno_mode_ok): Likewise.
+ * config/rl78/rl78.c (need_to_save): Likewise.
+ * config/rs6000/rs6000-logue.c (save_reg_p): Likewise.
+ (rs6000_stack_info, generate_set_vrsave): Likewise.
+ (rs6000_emit_prologue, rs6000_emit_epilogue): Likewise.
+ * config/rs6000/rs6000.c (rs6000_debug_reg_print): Likewise.
+ * config/rx/rx.c (rx_get_stack_layout): Likewise.
+ * config/s390/s390.c (s390_call_saved_register_used): Likewise.
+ * config/sh/sh.c (calc_live_regs, sh_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (save_global_or_fp_reg_p): Likewise.
+ (save_local_or_in_reg_p): Likewise.
+ * config/stormy16/stormy16.c (REG_NEEDS_SAVE): Likewise.
+ (xstormy16_epilogue_uses): Likewise.
+ * config/tilegx/tilegx.c (need_to_save_reg): Likewise.
+ * config/tilepro/tilepro.c (need_to_save_reg): Likewise.
+ * config/v850/v850.c (compute_register_save_size): Likewise.
+ * config/vax/vax.c (vax_expand_prologue): Likewise.
+ * config/visium/visium.c (visium_save_reg_p): Likewise.
+ * config/xtensa/xtensa.c (xtensa_call_save_reg): Likewise.
+ * cselib.c (cselib_process_insn): Likewise.
+ * df-scan.c (df_get_entry_block_def_set): Likewise.
+ * function.c (aggregate_value_p): Likewise.
+ * haifa-sched.c (alloc_global_sched_pressure_data): Likewise.
+ * ira-lives.c (process_bb_node_lives): Likewise.
+ * ira.c (do_reload): Likewise.
+ * lra-lives.c (process_bb_lives): Likewise.
+ * lra-remat.c (lra_remat): Likewise.
+ * lra.c (lra): Likewise.
+ * postreload.c (reload_combine_recognize_pattern): Likewise.
+ (reload_cse_move2add): Likewise.
+ * recog.c (peep2_find_free_register): Likewise.
+ * regrename.c (check_new_reg_p): Likewise.
+ * reload.c (find_equiv_reg): Likewise.
+ * reload1.c (reload, find_reg): Likewise.
+ * sel-sched.c (init_hard_regs_data): Likewise.
+
2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
* config/frv/frv.c (frv_ifcvt_modify_tests): Use
&& !fixed_regs[i])
{
target_avail_regs++;
- if (call_used_regs[i])
+ if (call_used_or_fixed_reg_p (i))
target_clobbered_regs++;
}
for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++)
if (df_regs_ever_live_p (regno)
&& (regno == R30_REGNUM
- || !call_used_regs[regno]))
+ || !call_used_or_fixed_reg_p (regno)))
cfun->machine->frame.reg_offset[regno] = SLOT_REQUIRED;
for (regno = V0_REGNUM; regno <= V31_REGNUM; regno++)
if (df_regs_ever_live_p (regno)
- && (!call_used_regs[regno]
+ && (!call_used_or_fixed_reg_p (regno)
|| (simd_function && FP_SIMD_SAVED_REGNUM_P (regno))))
{
cfun->machine->frame.reg_offset[regno] = SLOT_REQUIRED;
/* GPRs are used in a bb if they are in the IN, GEN, or KILL sets. */
for (unsigned regno = 0; regno <= LAST_SAVED_REGNUM; regno++)
- if ((!call_used_regs[regno]
+ if ((!call_used_or_fixed_reg_p (regno)
|| (simd_function && FP_SIMD_SAVED_REGNUM_P (regno)))
&& (bitmap_bit_p (in, regno)
|| bitmap_bit_p (gen, regno)
/* One for every register we have to save. */
for (unsigned i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
+ if (! fixed_regs[i] && ! call_used_or_fixed_reg_p (i)
&& df_regs_ever_live_p (i) && i != REG_RA)
sa_mask |= HOST_WIDE_INT_1U << i;
vms_save_fp_regno = -1;
if (vms_base_regno == HARD_FRAME_POINTER_REGNUM)
for (unsigned i = 0; i < 32; i++)
- if (! fixed_regs[i] && call_used_regs[i]
+ if (! fixed_regs[i] && call_used_or_fixed_reg_p (i)
&& ! df_regs_ever_live_p (i))
{
vms_save_fp_regno = i;
break;
}
- if (((df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
/* In an interrupt save everything. */
|| (ARC_INTERRUPT_P (fn_type)
&& (df_regs_ever_live_p (RETURN_ADDR_REGNUM)
if (epilogue_completed && ARC_INTERRUPT_P (fn_type))
{
/* An interrupt function restores more registers. */
- if (df_regs_ever_live_p (regno) || call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) || call_used_or_fixed_reg_p (regno))
return true;
}
warning (0, "%<-mpic-register=%> is useless without %<-fpic%>");
/* Prevent the user from choosing an obviously stupid PIC register. */
- else if (pic_register < 0 || call_used_regs[pic_register]
+ else if (pic_register < 0 || call_used_or_fixed_reg_p (pic_register)
|| pic_register == HARD_FRAME_POINTER_REGNUM
|| pic_register == STACK_POINTER_REGNUM
|| pic_register >= PC_REGNUM
{
/* Validate that r3 is a call-clobbered register (always true in
the default abi) ... */
- if (!call_used_regs[3])
+ if (!call_used_or_fixed_reg_p (3))
return 0;
/* ... that it isn't being used for a return value ... */
since this also requires an insn. */
if (TARGET_HARD_FLOAT)
for (regno = FIRST_VFP_REGNUM; regno <= LAST_VFP_REGNUM; regno++)
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
return 0;
if (TARGET_REALLY_IWMMXT)
for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && ! call_used_or_fixed_reg_p (regno))
return 0;
return 1;
registers are marked as caller saved when optimizing for size on Thumb-1
targets despite being callee saved in order to avoid using them. */
#define callee_saved_reg_p(reg) \
- (!call_used_regs[reg] \
+ (!call_used_or_fixed_reg_p (reg) \
|| (TARGET_THUMB1 && optimize_size \
&& reg >= FIRST_HI_REGNUM && reg <= LAST_HI_REGNUM))
for (reg = 0; reg <= max_reg; reg++)
if (df_regs_ever_live_p (reg)
- || (! crtl->is_leaf && call_used_regs[reg]))
+ || (! crtl->is_leaf && call_used_or_fixed_reg_p (reg)))
save_reg_mask |= (1 << reg);
/* Also save the pic base register if necessary. */
&& (save_reg_mask & THUMB2_WORK_REGS) == 0)
{
reg = thumb_find_work_register (1 << 4);
- if (!call_used_regs[reg])
+ if (!call_used_or_fixed_reg_p (reg))
save_reg_mask |= (1 << reg);
}
regno < LAST_VFP_REGNUM;
regno += 2)
{
- if ((!df_regs_ever_live_p (regno) || call_used_regs[regno])
- && (!df_regs_ever_live_p (regno + 1) || call_used_regs[regno + 1]))
+ if ((!df_regs_ever_live_p (regno)
+ || call_used_or_fixed_reg_p (regno))
+ && (!df_regs_ever_live_p (regno + 1)
+ || call_used_or_fixed_reg_p (regno + 1)))
{
if (count > 0)
{
for (regno = FIRST_IWMMXT_REGNUM;
regno <= LAST_IWMMXT_REGNUM;
regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if (df_regs_ever_live_p (regno)
+ && !call_used_or_fixed_reg_p (regno))
saved += 8;
}
rtx insn;
for (reg = LAST_IWMMXT_REGNUM; reg >= FIRST_IWMMXT_REGNUM; reg--)
- if (df_regs_ever_live_p (reg) && ! call_used_regs[reg])
+ if (df_regs_ever_live_p (reg) && !call_used_or_fixed_reg_p (reg))
{
insn = gen_rtx_PRE_DEC (Pmode, stack_pointer_rtx);
insn = gen_rtx_MEM (V2SImode, insn);
for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
{
- if ((!df_regs_ever_live_p (reg) || call_used_regs[reg])
- && (!df_regs_ever_live_p (reg + 1) || call_used_regs[reg + 1]))
+ if ((!df_regs_ever_live_p (reg) || call_used_or_fixed_reg_p (reg))
+ && (!df_regs_ever_live_p (reg + 1)
+ || call_used_or_fixed_reg_p (reg + 1)))
{
if (start_reg != reg)
saved_size += vfp_emit_fstmd (start_reg,
}
while (reg_base + n_free < 8 && !(live_regs_mask & 1)
- && (for_prologue || call_used_regs[reg_base + n_free]))
+ && (for_prologue || call_used_or_fixed_reg_p (reg_base + n_free)))
{
live_regs_mask >>= 1;
n_free++;
continue;
if (IN_RANGE (regno, IP_REGNUM, PC_REGNUM))
continue;
- if (call_used_regs[regno])
+ if (call_used_or_fixed_reg_p (regno))
bitmap_set_bit (to_clear_bitmap, regno);
}
/* Emit a clobber for each insn that will be restored in the epilogue,
so that flow2 will get register lifetimes correct. */
for (regno = 0; regno < 13; regno++)
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
emit_clobber (gen_rtx_REG (SImode, regno));
if (! df_regs_ever_live_p (LR_REGNUM))
for (i = FIRST_VFP_REGNUM; i < LAST_VFP_REGNUM; i += 2)
/* Look for a case where a reg does not need restoring. */
- if ((!df_regs_ever_live_p (i) || call_used_regs[i])
+ if ((!df_regs_ever_live_p (i) || call_used_or_fixed_reg_p (i))
&& (!df_regs_ever_live_p (i + 1)
- || call_used_regs[i + 1]))
+ || call_used_or_fixed_reg_p (i + 1)))
{
if (start_reg != i)
arm_emit_vfp_multi_reg_pop (start_reg,
int lrm_count = (num_regs % 2) ? (num_regs + 2) : (num_regs + 1);
for (i = LAST_IWMMXT_REGNUM; i >= FIRST_IWMMXT_REGNUM; i--)
- if (df_regs_ever_live_p (i) && !call_used_regs[i])
+ if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
{
rtx addr = gen_frame_mem (V2SImode,
plus_constant (Pmode, hard_frame_pointer_rtx,
unlike pop, vldm can only do consecutive regs. */
for (i = LAST_VFP_REGNUM - 1; i >= FIRST_VFP_REGNUM; i -= 2)
/* Look for a case where a reg does not need restoring. */
- if ((!df_regs_ever_live_p (i) || call_used_regs[i])
+ if ((!df_regs_ever_live_p (i) || call_used_or_fixed_reg_p (i))
&& (!df_regs_ever_live_p (i + 1)
- || call_used_regs[i + 1]))
+ || call_used_or_fixed_reg_p (i + 1)))
{
/* Restore the regs discovered so far (from reg+2 to
end_reg). */
if (TARGET_IWMMXT)
for (i = FIRST_IWMMXT_REGNUM; i <= LAST_IWMMXT_REGNUM; i++)
- if (df_regs_ever_live_p (i) && !call_used_regs[i])
+ if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
{
rtx_insn *insn;
rtx addr = gen_rtx_MEM (V2SImode,
if (fixed_regs[reg])
continue;
- if ((int_or_sig_p && !crtl->is_leaf && call_used_regs[reg])
+ if ((int_or_sig_p && !crtl->is_leaf && call_used_or_fixed_reg_p (reg))
|| (df_regs_ever_live_p (reg)
- && (int_or_sig_p || !call_used_regs[reg])
+ && (int_or_sig_p || !call_used_or_fixed_reg_p (reg))
/* Don't record frame pointer registers here. They are treated
indivitually in prologue. */
&& !(frame_pointer_needed
continue;
}
- if (!call_used_regs[reg])
+ if (!call_used_or_fixed_reg_p (reg))
{
if (df_regs_ever_live_p (reg))
{
if (cum->regno >= 8
&& cum->nregs >= 0
- && !call_used_regs[cum->regno])
+ && !call_used_or_fixed_reg_p (cum->regno))
{
/* FIXME: We ship info on failing tail-call in struct machine_function.
This uses internals of calls.c:expand_call() and the way args_so_far
&& (TREE_THIS_VOLATILE (current_function_decl)
|| cfun->machine->is_OS_task
|| cfun->machine->is_OS_main
- || (!isr_p && call_used_regs[regno])))
+ || (!isr_p && call_used_or_fixed_reg_p (regno))))
{
return reg;
}
&& REG_P (XEXP (XEXP (tem, 0), 0))
&& reg_overlap_mentioned_p (reg, XEXP (XEXP (tem, 0), 0)))
return 0;
- if (call_used_regs[REGNO (reg)])
+ if (call_used_or_fixed_reg_p (REGNO (reg)))
return 1;
}
return (is_eh_return_reg
|| (df_regs_ever_live_p (regno)
&& !fixed_regs[regno]
- && (is_inthandler || !call_used_regs[regno])));
+ && (is_inthandler || !call_used_or_fixed_reg_p (regno))));
}
else if (P_REGNO_P (regno))
{
return ((df_regs_ever_live_p (regno)
&& !fixed_regs[regno]
- && (is_inthandler || !call_used_regs[regno]))
+ && (is_inthandler || !call_used_or_fixed_reg_p (regno)))
|| (is_inthandler
&& (ENABLE_WA_05000283 || ENABLE_WA_05000315)
&& regno == REG_P5)
|| (TARGET_ID_SHARED_LIBRARY && !crtl->is_leaf))));
}
else
- return ((is_inthandler || !call_used_regs[regno])
+ return ((is_inthandler || !call_used_or_fixed_reg_p (regno))
&& (df_regs_ever_live_p (regno)
- || (!leaf_function_p () && call_used_regs[regno])));
+ || (!leaf_function_p () && call_used_or_fixed_reg_p (regno))));
}
if (saveall
|| (is_inthandler
&& (df_regs_ever_live_p (i)
- || (!leaf_function_p () && call_used_regs[i]))))
+ || (!leaf_function_p () && call_used_or_fixed_reg_p (i)))))
{
rtx_insn *insn;
if (i == REG_A0 || i == REG_A1)
if (saveall
|| (is_inthandler
&& (df_regs_ever_live_p (i)
- || (!leaf_function_p () && call_used_regs[i]))))
+ || (!leaf_function_p () && call_used_or_fixed_reg_p (i)))))
{
if (i == REG_A0 || i == REG_A1)
{
if (all
|| (fkind != SUBROUTINE
&& (df_regs_ever_live_p (i)
- || (!leaf_function_p () && call_used_regs[i]))))
+ || (!leaf_function_p () && call_used_or_fixed_reg_p (i)))))
n += i == REG_A0 || i == REG_A1 ? 2 : 1;
return n;
{
int i;
for (i = REG_P0; i <= REG_P5; i++)
- if ((df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if ((df_regs_ever_live_p (i) && ! call_used_or_fixed_reg_p (i))
|| (!TARGET_FDPIC
&& i == PIC_OFFSET_TABLE_REGNUM
&& (crtl->uses_pic_offset_table
for (i = REG_P0; i <= REG_P5; i++)
if ((df_regs_ever_live_p (i)
|| (funkind (TREE_TYPE (current_function_decl)) == SUBROUTINE
- && call_used_regs[i]))
+ && call_used_or_fixed_reg_p (i)))
&& !REGNO_REG_SET_P (df_get_live_out (bb_in), i))
{
scratchreg = gen_rtx_REG (SImode, i);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if ((!fixed_regs[regno]
&& df_regs_ever_live_p (regno)
- && !call_used_regs[regno])
+ && !call_used_or_fixed_reg_p (regno))
|| (cfun->calls_alloca
&& regno == STACK_POINTER_REGNUM))
cfun->machine->callee_saved_reg_size += 8;
{
if ((!fixed_regs[regno]
&& df_regs_ever_live_p (regno)
- && !call_used_regs[regno])
+ && !call_used_or_fixed_reg_p (regno))
|| (cfun->calls_alloca
&& regno == STACK_POINTER_REGNUM))
{
{
if ((!fixed_regs[regno]
&& df_regs_ever_live_p (regno)
- && !call_used_regs[regno])
+ && !call_used_or_fixed_reg_p (regno))
|| (cfun->calls_alloca
&& regno == STACK_POINTER_REGNUM))
{
c6x_save_reg (unsigned int regno)
{
return ((df_regs_ever_live_p (regno)
- && !call_used_regs[regno]
+ && !call_used_or_fixed_reg_p (regno)
&& !fixed_regs[regno])
|| (regno == RETURN_ADDR_REGNO
&& (df_regs_ever_live_p (regno)
if (A_REGNO_P (reg))
return NONPREDICATE_A_REGS;
- if (call_used_regs[reg])
+ if (call_used_or_fixed_reg_p (reg))
return CALL_USED_B_REGS;
return B_REGS;
/* If this reg is used and not call-used (except RA), save it. */
if (cr16_interrupt_function_p ())
{
- if (!crtl->is_leaf && call_used_regs[regno])
+ if (!crtl->is_leaf && call_used_or_fixed_reg_p (regno))
/* This is a volatile reg in a non-leaf interrupt routine - save
it for the sake of its sons. */
current_frame_info.save_regs[regno] = 1;
{
/* If this reg is used and not call-used (except RA), save it. */
if (df_regs_ever_live_p (regno)
- && (!call_used_regs[regno] || regno == RETURN_ADDRESS_REGNUM))
+ && (!call_used_or_fixed_reg_p (regno)
+ || regno == RETURN_ADDRESS_REGNUM))
current_frame_info.save_regs[regno] = 1;
else
current_frame_info.save_regs[regno] = 0;
{
return
(((df_regs_ever_live_p (regno)
- && !call_used_regs[regno])
+ && !call_used_or_fixed_reg_p (regno))
|| (regno == PIC_OFFSET_TABLE_REGNUM
&& (got_really_used
/* It is saved anyway, if there would be a gap. */
|| (flag_pic
&& df_regs_ever_live_p (regno + 1)
- && !call_used_regs[regno + 1]))))
+ && !call_used_or_fixed_reg_p (regno + 1)))))
&& (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed)
&& regno != CRIS_SRP_REGNUM)
|| (crtl->calls_eh_return
epiphany_regno_reg_class[i] = LR_REGS;
else if (i <= 7 && TARGET_PREFER_SHORT_INSN_REGS)
epiphany_regno_reg_class[i] = SHORT_INSN_REGS;
- else if (call_used_regs[i]
+ else if (call_used_or_fixed_reg_p (i)
&& TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i))
epiphany_regno_reg_class[i] = SIBCALL_REGS;
else if (i >= CORE_CONTROL_FIRST && i <= CORE_CONTROL_LAST)
#define MUST_SAVE_REGISTER(regno, interrupt_p) \
((df_regs_ever_live_p (regno) \
|| (interrupt_p && !crtl->is_leaf \
- && call_used_regs[regno] && !fixed_regs[regno])) \
- && (!call_used_regs[regno] || regno == GPR_LR \
+ && call_used_or_fixed_reg_p (regno) && !fixed_regs[regno])) \
+ && (!call_used_or_fixed_reg_p (regno) || regno == GPR_LR \
|| (interrupt_p && regno != GPR_SP)))
#define MUST_SAVE_RETURN_ADDR 0
assemble_start_function (thunk, fnname);
/* We use IP and R16 as a scratch registers. */
- gcc_assert (call_used_regs [GPR_IP]);
- gcc_assert (call_used_regs [GPR_16]);
+ gcc_assert (call_used_or_fixed_reg_p (GPR_IP));
+ gcc_assert (call_used_or_fixed_reg_p (GPR_16));
/* Add DELTA. When possible use a plain add, otherwise load it into
a register first. */
fputs ("\tstrd r0,[sp,-1]\n", file);
else
tmp = GPR_16;
- gcc_assert (call_used_regs[tmp]);
+ gcc_assert (call_used_or_fixed_reg_p (tmp));
fprintf (file, "\tmov r%d,%%low(", tmp);
assemble_name (file, dst_name);
fprintf (file, ")\n"
( (regno) != RETURN_POINTER_REGNUM \
&& (regno) != FRAME_POINTER_REGNUM \
&& df_regs_ever_live_p (regno) \
- && ! call_used_regs [regno] )
+ && ! call_used_or_fixed_reg_p (regno))
#define MUST_SAVE_FRAME_POINTER (df_regs_ever_live_p (FRAME_POINTER_REGNUM) || frame_pointer_needed)
#define MUST_SAVE_RETURN_POINTER (df_regs_ever_live_p (RETURN_POINTER_REGNUM) || crtl->profile)
default:
for (regno = first; regno <= last; regno++)
{
- if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if ((df_regs_ever_live_p (regno)
+ && !call_used_or_fixed_reg_p (regno))
|| (crtl->calls_eh_return
&& (regno >= FIRST_EH_REGNUM && regno <= LAST_EH_REGNUM))
|| (!TARGET_FDPIC && flag_pic
/* Save callee-saved registers. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if (df_regs_ever_live_p (regno) && (!call_used_regs[regno]))
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
cfun->machine->callee_saved_reg_size += 4;
cfun->machine->size_for_adjusting_sp =
{
for (regno = FIRST_PSEUDO_REGISTER; regno-- > 0;)
{
- if (!fixed_regs[regno] && !call_used_regs[regno]
+ if (!fixed_regs[regno] && !call_used_or_fixed_reg_p (regno)
&& df_regs_ever_live_p (regno))
{
rtx preg = gen_rtx_REG (Pmode, regno);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
if (!fixed_regs[regno] && df_regs_ever_live_p (regno)
- && !call_used_regs[regno])
+ && !call_used_or_fixed_reg_p (regno))
{
insn = emit_insn (gen_movsi_push (gen_rtx_REG (Pmode, regno)));
RTX_FRAME_RELATED_P (insn) = 1;
{
for (regno = FIRST_PSEUDO_REGISTER; regno-- > 0;)
{
- if (!fixed_regs[regno] && !call_used_regs[regno]
+ if (!fixed_regs[regno] && !call_used_or_fixed_reg_p (regno)
&& df_regs_ever_live_p (regno))
{
rtx preg = gen_rtx_REG (Pmode, regno);
offsets->callee_saves = offsets->lr_needs_saving ? 8 : 0;
for (int regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if ((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| ((regno & ~1) == HARD_FRAME_POINTER_REGNUM
&& frame_pointer_needed))
offsets->callee_saves += (VGPR_REGNO_P (regno) ? 256 : 4);
/* Move scalars into two vector registers. */
for (regno = 0, saved_scalars = 0; regno < FIRST_VGPR_REG; regno++)
- if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if ((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| ((regno & ~1) == LINK_REGNUM && offsets->lr_needs_saving)
|| ((regno & ~1) == HARD_FRAME_POINTER_REGNUM
&& offsets->need_frame_pointer))
/* Move vectors. */
for (regno = FIRST_VGPR_REG, offset = offsets->pretend_size;
regno < FIRST_PSEUDO_REGISTER; regno++)
- if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if ((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| (regno == VGPR_REGNO (6) && saved_scalars > 0)
|| (regno == VGPR_REGNO (7) && saved_scalars > 63))
{
&& ! TREE_THIS_VOLATILE (current_function_decl) \
&& (h8300_saveall_function_p (current_function_decl) \
/* Save any call saved register that was used. */ \
- || (df_regs_ever_live_p (regno) && !call_used_regs[regno]) \
+ || (df_regs_ever_live_p (regno) \
+ && !call_used_or_fixed_reg_p (regno)) \
/* Save the frame pointer if it was used. */ \
|| (regno == HARD_FRAME_POINTER_REGNUM && df_regs_ever_live_p (regno)) \
/* Save any register used in an interrupt handler. */ \
/* Save call clobbered registers in non-leaf interrupt \
handlers. */ \
|| (h8300_current_function_interrupt_function_p () \
- && call_used_regs[regno] \
+ && call_used_or_fixed_reg_p (regno) \
&& !crtl->is_leaf)))
/* We use this to wrap all emitted insns in the prologue. */
Avoid expensive re-initialization of init_regs each time we switch
function context. */
if (TARGET_64BIT
- && (call_used_regs[SI_REG]
+ && (call_used_or_fixed_reg_p (SI_REG)
== (cfun->machine->call_abi == MS_ABI)))
reinit_regs ();
/* Need to re-initialize init_regs if caller-saved registers are
return true;
return (df_regs_ever_live_p (regno)
- && !call_used_regs[regno]
+ && !call_used_or_fixed_reg_p (regno)
&& !fixed_regs[regno]
&& (regno != HARD_FRAME_POINTER_REGNUM || !frame_pointer_needed));
}
"around by avoiding functions with aggregate return.");
/* Only need to push parameter pointer reg if it is caller saved. */
- if (!call_used_regs[REGNO (crtl->drap_reg)])
+ if (!call_used_or_fixed_reg_p (REGNO (crtl->drap_reg)))
{
/* Push arg pointer reg */
insn = emit_insn (gen_push (crtl->drap_reg));
if (ix86_static_chain_on_stack)
stack_size += UNITS_PER_WORD;
- if (!call_used_regs[REGNO (crtl->drap_reg)])
+ if (!call_used_or_fixed_reg_p (REGNO (crtl->drap_reg)))
stack_size += UNITS_PER_WORD;
/* This over-estimates by 1 minimal-stack-alignment-unit but
if (ix86_static_chain_on_stack)
param_ptr_offset += UNITS_PER_WORD;
- if (!call_used_regs[REGNO (crtl->drap_reg)])
+ if (!call_used_or_fixed_reg_p (REGNO (crtl->drap_reg)))
param_ptr_offset += UNITS_PER_WORD;
insn = emit_insn (gen_rtx_SET
GEN_INT (param_ptr_offset)));
RTX_FRAME_RELATED_P (insn) = 1;
- if (!call_used_regs[REGNO (crtl->drap_reg)])
+ if (!call_used_or_fixed_reg_p (REGNO (crtl->drap_reg)))
ix86_emit_restore_reg_using_pop (crtl->drap_reg);
}
/* First allocate the local general purpose registers. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (GENERAL_REGNO_P (i) && call_used_regs[i])
+ if (GENERAL_REGNO_P (i) && call_used_or_fixed_reg_p (i))
reg_alloc_order [pos++] = i;
/* Global general purpose registers. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (GENERAL_REGNO_P (i) && !call_used_regs[i])
+ if (GENERAL_REGNO_P (i) && !call_used_or_fixed_reg_p (i))
reg_alloc_order [pos++] = i;
/* x87 registers come first in case we are doing FP math
if (GET_CODE (op) == PLUS && REG_P (XEXP (op, 0)))
{
int regno = REGNO (XEXP (op, 0));
- if (!HARD_REGISTER_NUM_P (regno) || call_used_regs[regno])
+ if (!HARD_REGISTER_NUM_P (regno) || call_used_or_fixed_reg_p (regno))
{
op = XEXP (op, 1);
if (GOT32_symbol_operand (op, VOIDmode))
out_state = 0;
while (1)
{
- while (rs < 64 && call_used_regs[PR_REG (rs)])
+ while (rs < 64 && call_used_or_fixed_reg_p (PR_REG (rs)))
rs++;
if (rs >= 64)
break;
- for (re = rs + 1; re < 64 && ! call_used_regs[PR_REG (re)]; re++)
+ for (re = rs + 1;
+ re < 64 && ! call_used_or_fixed_reg_p (PR_REG (re)); re++)
continue;
if (out_state == 0)
{
{
for (regno = GR_REG (1); regno <= GR_REG (31); regno++)
if (! df_regs_ever_live_p (regno)
- && call_used_regs[regno]
+ && call_used_or_fixed_reg_p (regno)
&& ! fixed_regs[regno]
&& ! global_regs[regno]
&& ((current_frame_info.gr_used_mask >> regno) & 1) == 0
for (i = 0; i < 32; ++i)
{
regno = (last_scratch_gr_reg + i + 1) & 31;
- if (call_used_regs[regno]
+ if (call_used_or_fixed_reg_p (regno)
&& ! fixed_regs[regno]
&& ! global_regs[regno]
&& ((current_frame_info.gr_used_mask >> regno) & 1) == 0)
which will always wind up on the stack. */
for (regno = FR_REG (2); regno <= FR_REG (127); regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && ! call_used_or_fixed_reg_p (regno))
{
SET_HARD_REG_BIT (mask, regno);
spill_size += 16;
}
for (regno = GR_REG (1); regno <= GR_REG (31); regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && ! call_used_or_fixed_reg_p (regno))
{
SET_HARD_REG_BIT (mask, regno);
spill_size += 8;
}
for (regno = BR_REG (1); regno <= BR_REG (7); regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && ! call_used_or_fixed_reg_p (regno))
{
SET_HARD_REG_BIT (mask, regno);
spill_size += 8;
}
else
{
- if (df_regs_ever_live_p (BR_REG (0)) && ! call_used_regs[BR_REG (0)])
+ if (df_regs_ever_live_p (BR_REG (0))
+ && ! call_used_or_fixed_reg_p (BR_REG (0)))
{
SET_HARD_REG_BIT (mask, BR_REG (0));
extra_spill_size += 8;
/* See if we need to store the predicate register block. */
for (regno = PR_REG (0); regno <= PR_REG (63); regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && ! call_used_or_fixed_reg_p (regno))
break;
if (regno <= PR_REG (63))
{
/* Tell prologue and epilogue if register REGNO should be saved / restored. */
#define MUST_SAVE_REGISTER(regno) \
- ((df_regs_ever_live_p (regno) && !call_used_regs[regno]) \
+ ((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno)) \
|| (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) \
|| (regno == (GP_REG_FIRST + 31) && df_regs_ever_live_p (GP_REG_FIRST + 31)))
and calculate size required to store them in the stack. */
for (regno = 1; regno < SP_REGNUM; regno++)
{
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
{
reg_save_mask |= 1 << regno;
callee_size += UNITS_PER_WORD;
))
return 1;
if (df_regs_ever_live_p (regno)
- && (!call_used_regs[regno] || cfun->machine->is_interrupt))
+ && (!call_used_or_fixed_reg_p (regno) || cfun->machine->is_interrupt))
return 1;
return 0;
}
if (df_regs_ever_live_p (regno))
return true;
- if (!crtl->is_leaf && call_used_regs[regno])
+ if (!crtl->is_leaf && call_used_or_fixed_reg_p (regno))
return true;
}
return false;
/* Otherwise save everything that isn't call-clobbered. */
- return !call_used_regs[regno];
+ return !call_used_or_fixed_reg_p (regno);
}
/* Emit RTL for a MOVEM or FMOVEM instruction. BASE + OFFSET represents
for (reg = 0; reg < FIRST_PSEUDO_REGISTER; reg++)
{
- if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
+ if (df_regs_ever_live_p (reg) && !call_used_or_fixed_reg_p (reg))
{
(*count)++;
live_regs_mask |= (1 << reg);
(regno == MB_ABI_PIC_ADDR_REGNUM) && df_regs_ever_live_p (regno))
return 1;
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
return 1;
if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM))
int
mmix_local_regno (int regno)
{
- return regno <= MMIX_LAST_STACK_REGISTER_REGNUM && !call_used_regs[regno];
+ return (regno <= MMIX_LAST_STACK_REGISTER_REGNUM
+ && !call_used_or_fixed_reg_p (regno));
}
/* TARGET_PREFERRED_RELOAD_CLASS.
for (regno = MMIX_FIRST_GLOBAL_REGNUM;
regno <= 255;
regno++)
- if ((df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ if ((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| IS_MMIX_EH_RETURN_DATA_REG (regno))
fp_sp_offset += 8;
for (regno = MMIX_LAST_STACK_REGISTER_REGNUM;
regno >= 0;
regno--)
- if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if ((df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| (regno == MMIX_FRAME_POINTER_REGNUM && frame_pointer_needed))
break;
/* Note that we assume that the frame-pointer-register is one of these
registers, in which case we don't count it here. */
if ((((regno != MMIX_FRAME_POINTER_REGNUM || !frame_pointer_needed)
- && df_regs_ever_live_p (regno) && !call_used_regs[regno]))
+ && df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno)))
|| IS_MMIX_EH_RETURN_DATA_REG (regno))
return 0;
/* Note that we assume that the frame-pointer-register is one of these
registers, in which case we don't count it here. */
if ((((regno != MMIX_FRAME_POINTER_REGNUM || !frame_pointer_needed)
- && df_regs_ever_live_p (regno) && !call_used_regs[regno]))
+ && df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno)))
|| IS_MMIX_EH_RETURN_DATA_REG (regno))
stack_space_to_allocate += 8;
regno >= MMIX_FIRST_GLOBAL_REGNUM;
regno--)
if (((regno != MMIX_FRAME_POINTER_REGNUM || !frame_pointer_needed)
- && df_regs_ever_live_p (regno) && ! call_used_regs[regno])
+ && df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| IS_MMIX_EH_RETURN_DATA_REG (regno))
{
rtx insn;
regno >= MMIX_FIRST_GLOBAL_REGNUM;
regno--)
if (((regno != MMIX_FRAME_POINTER_REGNUM || !frame_pointer_needed)
- && df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ && df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| IS_MMIX_EH_RETURN_DATA_REG (regno))
stack_space_to_deallocate += 8;
regno <= 255;
regno++)
if (((regno != MMIX_FRAME_POINTER_REGNUM || !frame_pointer_needed)
- && df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ && df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
|| IS_MMIX_EH_RETURN_DATA_REG (regno))
{
if (offset > 255)
/* Save callee-saved registers. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if (df_regs_ever_live_p (regno) && (! call_used_regs[regno]))
+ if (df_regs_ever_live_p (regno) && (! call_used_or_fixed_reg_p (regno)))
cfun->machine->callee_saved_reg_size += 4;
cfun->machine->size_for_adjusting_sp =
/* Save callee-saved registers. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
- if (!fixed_regs[regno] && df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (!fixed_regs[regno]
+ && df_regs_ever_live_p (regno)
+ && !call_used_or_fixed_reg_p (regno))
{
insn = emit_insn (gen_movsi_push (gen_rtx_REG (Pmode, regno)));
RTX_FRAME_RELATED_P (insn) = 1;
emit_insn (gen_addsi3 (reg, reg, hard_frame_pointer_rtx));
}
for (regno = FIRST_PSEUDO_REGISTER; regno-- > 0; )
- if (!fixed_regs[regno] && !call_used_regs[regno]
+ if (!fixed_regs[regno] && !call_used_or_fixed_reg_p (regno)
&& df_regs_ever_live_p (regno))
{
rtx preg = gen_rtx_REG (Pmode, regno);
return true;
}
- if (!call_used_regs[regno]
+ if (!call_used_or_fixed_reg_p (regno)
&& df_regs_ever_live_p (regno))
return true;
As long as the register satisfies both criteria above,
it is required to be saved. */
#define NDS32_REQUIRED_CALLEE_SAVED_P(regno) \
- ((!call_used_regs[regno]) && (df_regs_ever_live_p (regno)))
+ (!call_used_or_fixed_reg_p (regno) && df_regs_ever_live_p (regno))
/* This macro is to check if the push25/pop25 are available to be used
for code generation. Because pop25 also performs return behavior,
{
gcc_assert (GP_REG_P (regno));
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
return true;
if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)
callee_saved_regno_p (int regno)
{
/* Check call-saved registers. */
- if (!call_used_regs[regno] && df_regs_ever_live_p (regno))
+ if (!call_used_or_fixed_reg_p (regno) && df_regs_ever_live_p (regno))
return true;
switch (regno)
}
for (i = 18; i >= 4; i--)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
{
store_reg (i, offset, HARD_FRAME_POINTER_REGNUM);
offset += UNITS_PER_WORD;
}
for (i = 18; i >= 3; i--)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
{
/* If merge_sp_adjust_with_store is nonzero, then we can
optimize the first GR save. */
}
for (i = 18; i >= 4; i--)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
{
load_reg (i, offset, HARD_FRAME_POINTER_REGNUM);
offset += UNITS_PER_WORD;
for (i = 18; i >= 3; i--)
{
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
{
/* Only for the first load.
merge_sp_adjust_with_load holds the register load
static inline bool
pdp11_saved_regno (unsigned regno)
{
- return !call_used_regs[regno] && df_regs_ever_live_p (regno);
+ return !call_used_or_fixed_reg_p (regno) && df_regs_ever_live_p (regno);
}
/* Expand the function prologue. */
{
gcc_assert (GP_REG_P (regno));
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
return true;
/* 32-bit FP. */
static bool
riscv_save_reg_p (unsigned int regno)
{
- bool call_saved = !global_regs[regno] && !call_used_regs[regno];
+ bool call_saved = !global_regs[regno] && !call_used_or_fixed_reg_p (regno);
bool might_clobber = crtl->saves_all_registers
|| df_regs_ever_live_p (regno);
/* We must save every register used in this function. If this is not a
leaf function, then we must save all temporary registers. */
if (df_regs_ever_live_p (regno)
- || (!crtl->is_leaf && call_used_regs[regno]))
+ || (!crtl->is_leaf && call_used_or_fixed_reg_p (regno)))
return true;
}
/* An interrupt function restores temp regs, so we must indicate that
they are live at function end. */
if (df_regs_ever_live_p (regno)
- || (!crtl->is_leaf && call_used_regs[regno]))
+ || (!crtl->is_leaf && call_used_or_fixed_reg_p (regno)))
return true;
}
/* Only use callee-saved registers if a potential callee is guaranteed
to spill the requisite width. */
if (GET_MODE_UNIT_SIZE (mode) > UNITS_PER_FP_REG
- || (!call_used_regs[regno]
+ || (!call_used_or_fixed_reg_p (regno)
&& GET_MODE_UNIT_SIZE (mode) > UNITS_PER_FP_ARG))
return false;
}
/* Require same callee-savedness for all registers. */
for (unsigned i = 1; i < nregs; i++)
- if (call_used_regs[regno] != call_used_regs[regno + i])
+ if (call_used_or_fixed_reg_p (regno)
+ != call_used_or_fixed_reg_p (regno + i))
return false;
return true;
any call_used registers, so we have to preserve them.
We do not have to worry about the frame pointer register
though, as that is handled below. */
- if (!crtl->is_leaf && call_used_regs[regno] && regno < 22)
+ if (!crtl->is_leaf && call_used_or_fixed_reg_p (regno) && regno < 22)
return true;
/* Otherwise we only have to save a register, call_used
if (crtl->calls_eh_return)
return true;
if (df_regs_ever_live_p (regno)
- && !call_used_regs[regno])
+ && !call_used_or_fixed_reg_p (regno))
return true;
return false;
}
return true;
}
- return !call_used_regs[reg] && df_regs_ever_live_p (reg);
+ return !call_used_or_fixed_reg_p (reg) && df_regs_ever_live_p (reg);
}
/* Return the first fixed-point register that is required to be
using_static_chain_p = (cfun->static_chain_decl != NULL_TREE
&& df_regs_ever_live_p (STATIC_CHAIN_REGNUM)
- && call_used_regs[STATIC_CHAIN_REGNUM]);
+ && call_used_or_fixed_reg_p (STATIC_CHAIN_REGNUM));
info->savres_strategy = rs6000_savres_strategy (info, using_static_chain_p);
if (!(info->savres_strategy & SAVE_INLINE_GPRS)
for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)
if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
{
- if (!epiloguep || call_used_regs [i])
+ if (!epiloguep || call_used_or_fixed_reg_p (i))
clobs[nclobs++] = gen_hard_reg_clobber (V4SImode, i);
else
{
rtx cr_save_rtx = NULL_RTX;
rtx_insn *insn;
int strategy;
- int using_static_chain_p = (cfun->static_chain_decl != NULL_TREE
- && df_regs_ever_live_p (STATIC_CHAIN_REGNUM)
- && call_used_regs[STATIC_CHAIN_REGNUM]);
+ int using_static_chain_p
+ = (cfun->static_chain_decl != NULL_TREE
+ && df_regs_ever_live_p (STATIC_CHAIN_REGNUM)
+ && call_used_or_fixed_reg_p (STATIC_CHAIN_REGNUM));
int using_split_stack = (flag_split_stack
&& (lookup_attribute ("no_split_stack",
DECL_ATTRIBUTES (cfun->decl))
emit_insn (gen_prologue_movesi_from_cr (crsave));
for (i = 0; i < 8; i++)
- if (!call_used_regs[CR0_REGNO + i])
+ if (!call_used_or_fixed_reg_p (CR0_REGNO + i))
{
rtvec p = rtvec_alloc (2);
RTVEC_ELT (p, 0)
int i, cr_off = info->ehcr_offset;
for (i = 0; i < 8; i++)
- if (!call_used_regs[CR0_REGNO + i])
+ if (!call_used_or_fixed_reg_p (CR0_REGNO + i))
{
rtx reg = gen_rtx_REG (SImode, 0);
emit_insn (gen_frame_load (reg, frame_reg_rtx,
comma = ", ";
}
- if (call_used_regs[r])
+ if (call_used_or_fixed_reg_p (r))
{
if (len > 70)
{
/* Always save all call clobbered registers inside non-leaf
interrupt handlers, even if they are not live - they may
be used in (non-interrupt aware) routines called from this one. */
- || (call_used_regs[reg]
+ || (call_used_or_fixed_reg_p (reg)
&& is_interrupt_func (NULL_TREE)
&& ! crtl->is_leaf))
- && (! call_used_regs[reg]
+ && (! call_used_or_fixed_reg_p (reg)
/* Even call clobbered registered must
be pushed inside interrupt handlers. */
|| is_interrupt_func (NULL_TREE)
if (REG_P (parm_rtx))
{
for (reg = 0; reg < REG_NREGS (parm_rtx); reg++)
- if (!call_used_regs[reg + REGNO (parm_rtx)])
+ if (!call_used_or_fixed_reg_p (reg + REGNO (parm_rtx)))
return true;
}
gcc_assert (REG_P (r));
for (reg = 0; reg < REG_NREGS (r); reg++)
- if (!call_used_regs[reg + REGNO (r)])
+ if (!call_used_or_fixed_reg_p (reg + REGNO (r)))
return true;
}
}
|| (df_regs_ever_live_p (reg)
&& ((!call_really_used_regs[reg]
&& !(reg != PIC_OFFSET_TABLE_REGNUM
- && fixed_regs[reg] && call_used_regs[reg]))
+ && fixed_regs[reg]
+ && call_used_or_fixed_reg_p (reg)))
|| (trapa_handler && reg == FPSCR_REG && TARGET_FPU_ANY)))
|| (crtl->calls_eh_return
&& (reg == EH_RETURN_DATA_REGNO (0)
registers are used for argument passing, are callee-saved, or reserved. */
/* We need to check call_used_regs / fixed_regs in case -fcall_saved-reg /
-ffixed-reg has been used. */
- if (! call_used_regs[0] || fixed_regs[0])
+ if (! call_used_or_fixed_reg_p (0) || fixed_regs[0])
error ("r0 needs to be available as a call-clobbered register");
scratch0 = scratch1 = scratch2 = gen_rtx_REG (Pmode, 0);
{
- if (call_used_regs[1] && ! fixed_regs[1])
+ if (call_used_or_fixed_reg_p (1) && ! fixed_regs[1])
scratch1 = gen_rtx_REG (ptr_mode, 1);
/* N.B., if not TARGET_HITACHI, register 2 is used to pass the pointer
pointing where to return struct values. */
- if (call_used_regs[3] && ! fixed_regs[3])
+ if (call_used_or_fixed_reg_p (3) && ! fixed_regs[3])
scratch2 = gen_rtx_REG (Pmode, 3);
}
save_global_or_fp_reg_p (unsigned int regno,
int leaf_function ATTRIBUTE_UNUSED)
{
- return !call_used_regs[regno] && df_regs_ever_live_p (regno);
+ return !call_used_or_fixed_reg_p (regno) && df_regs_ever_live_p (regno);
}
/* Return whether the return address register (%i7) is needed. */
save_local_or_in_reg_p (unsigned int regno, int leaf_function)
{
/* General case: call-saved registers live at some point. */
- if (!call_used_regs[regno] && df_regs_ever_live_p (regno))
+ if (!call_used_or_fixed_reg_p (regno) && df_regs_ever_live_p (regno))
return true;
/* Frame pointer register (%fp) if needed. */
/* Does REGNO need to be saved? */
#define REG_NEEDS_SAVE(REGNUM, IFUN) \
- ((df_regs_ever_live_p (REGNUM) && ! call_used_regs[REGNUM]) \
- || (IFUN && ! fixed_regs[REGNUM] && call_used_regs[REGNUM] \
+ ((df_regs_ever_live_p (REGNUM) && !call_used_or_fixed_reg_p (REGNUM)) \
+ || (IFUN && !fixed_regs[REGNUM] && call_used_or_fixed_reg_p (REGNUM) \
&& (REGNUM != CARRY_REGNUM) \
&& (df_regs_ever_live_p (REGNUM) || ! crtl->is_leaf)))
int
xstormy16_epilogue_uses (int regno)
{
- if (reload_completed && call_used_regs[regno])
+ if (reload_completed && call_used_or_fixed_reg_p (regno))
{
const int ifun = xstormy16_interrupt_function_p ();
return REG_NEEDS_SAVE (regno, ifun);
static bool
need_to_save_reg (unsigned int regno)
{
- if (!fixed_regs[regno] && !call_used_regs[regno]
+ if (!fixed_regs[regno] && !call_used_or_fixed_reg_p (regno)
&& df_regs_ever_live_p (regno))
return true;
static bool
need_to_save_reg (unsigned int regno)
{
- if (!fixed_regs[regno] && !call_used_regs[regno]
+ if (!fixed_regs[regno] && !call_used_or_fixed_reg_p (regno)
&& df_regs_ever_live_p (regno))
return true;
{
/* Find the first register that needs to be saved. */
for (i = 0; i <= 31; i++)
- if (df_regs_ever_live_p (i) && ((! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && ((! call_used_or_fixed_reg_p (i))
|| i == LINK_POINTER_REGNUM))
break;
else
{
for (; i <= 31; i++)
- if (df_regs_ever_live_p (i) && ((! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && ((! call_used_or_fixed_reg_p (i))
|| i == LINK_POINTER_REGNUM))
{
size += 4;
rtx insn;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
+ if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
mask |= 1 << regno;
insn = emit_insn (gen_procedure_entry_mask (GEN_INT (mask)));
if (df_regs_ever_live_p (regno))
return 1;
}
- else if (call_used_regs[regno])
+ else if (call_used_or_fixed_reg_p (regno))
return 1;
/* To save mdb requires two temporary registers. To save mdc or
}
}
- return df_regs_ever_live_p (regno) && !call_used_regs[regno];
+ return df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno);
}
/* Compute the frame size required by the function. This function is called
if (crtl->calls_eh_return && regno >= 2 && regno < 4)
return true;
- return !fixed_regs[regno] && !call_used_regs[regno] &&
+ return !fixed_regs[regno] && !call_used_or_fixed_reg_p (regno) &&
df_regs_ever_live_p (regno);
}
if (CALL_P (insn))
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i]
+ if (call_used_or_fixed_reg_p (i)
|| (REG_VALUES (i) && REG_VALUES (i)->elt
&& (targetm.hard_regno_call_part_clobbered
(insn, i, GET_MODE (REG_VALUES (i)->elt->val_rtx)))))
/* Defs for the callee saved registers are inserted so that the
pushes have some defining location. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if ((call_used_regs[i] == 0) && (df_regs_ever_live_p (i)))
+ if ((call_used_or_fixed_reg_p (i) == 0) && (df_regs_ever_live_p (i)))
bitmap_set_bit (entry_block_defs, i);
}
regno = REGNO (reg);
nregs = hard_regno_nregs (regno, TYPE_MODE (type));
for (i = 0; i < nregs; i++)
- if (! call_used_regs[regno + i])
+ if (! call_used_or_fixed_reg_p (regno + i))
return 1;
return 0;
fixed_regs_num[cl] = 0;
for (int i = 0; i < ira_class_hard_regs_num[cl]; ++i)
- if (!call_used_regs[ira_class_hard_regs[cl][i]])
+ if (!call_used_or_fixed_reg_p (ira_class_hard_regs[cl][i]))
++call_saved_regs_num[cl];
else if (fixed_regs[ira_class_hard_regs[cl][i]])
++fixed_regs_num[cl];
#define REG_CAN_CHANGE_MODE_P(REGN, FROM, TO) \
(targetm.can_change_mode_class (FROM, TO, REGNO_REG_CLASS (REGN)))
+/* Return true if register REGNO is either fixed or call-used
+ (aka call-clobbered). */
+
+inline bool
+call_used_or_fixed_reg_p (unsigned int regno)
+{
+ return fixed_regs[regno] || call_used_regs[regno];
+}
+
#endif /* ! GCC_HARD_REG_SET_H */
if (!cfun->has_nonlocal_label
&& has_abnormal_call_or_eh_pred_edge_p (bb))
for (px = 0; px < FIRST_PSEUDO_REGISTER; px++)
- if (call_used_regs[px]
+ if (call_used_or_fixed_reg_p (px)
#ifdef REAL_PIC_OFFSET_TABLE_REGNUM
/* We should create a conflict of PIC pseudo with
PIC hard reg as PIC hard reg can have a wrong
poly_int64 size = get_frame_size () + STACK_CHECK_FIXED_FRAME_SIZE;
for (int i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (df_regs_ever_live_p (i) && !fixed_regs[i] && call_used_regs[i])
+ if (df_regs_ever_live_p (i)
+ && !fixed_regs[i]
+ && call_used_or_fixed_reg_p (i))
size += UNITS_PER_WORD;
if (constant_lower_bound (size) > STACK_CHECK_MAX_FRAME_SIZE)
if (!cfun->has_nonlocal_label
&& has_abnormal_call_or_eh_pred_edge_p (bb))
for (px = 0; HARD_REGISTER_NUM_P (px); px++)
- if (call_used_regs[px]
+ if (call_used_or_fixed_reg_p (px)
#ifdef REAL_PIC_OFFSET_TABLE_REGNUM
/* We should create a conflict of PIC pseudo with PIC
hard reg as PIC hard reg can have a wrong value after
all_cands.create (8000);
call_used_regs_arr_len = 0;
for (int i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i])
+ if (call_used_or_fixed_reg_p (i))
call_used_regs_arr[call_used_regs_arr_len++] = i;
initiate_cand_table ();
create_remat_bb_data ();
if (crtl->saves_all_registers)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
+ if (!call_used_or_fixed_reg_p (i) && !fixed_regs[i] && !LOCAL_REGNO (i))
df_set_regs_ever_live (i, true);
/* We don't DF from now and avoid its using because it is to
if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], i)
&& reg_state[i].use_index == RELOAD_COMBINE_MAX_USES
&& reg_state[i].store_ruid <= reg_state[regno].use_ruid
- && (call_used_regs[i] || df_regs_ever_live_p (i))
+ && (call_used_or_fixed_reg_p (i) || df_regs_ever_live_p (i))
&& (!frame_pointer_needed || i != HARD_FRAME_POINTER_REGNUM)
&& !fixed_regs[i] && !global_regs[i]
&& hard_regno_nregs (i, GET_MODE (reg)) == 1
{
for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
{
- if (call_used_regs[i])
+ if (call_used_or_fixed_reg_p (i))
/* Reset the information about this register. */
reg_mode[i] = VOIDmode;
}
break;
}
/* And that we don't create an extra save/restore. */
- if (! call_used_regs[regno + j] && ! df_regs_ever_live_p (regno + j))
+ if (! call_used_or_fixed_reg_p (regno + j)
+ && ! df_regs_ever_live_p (regno + j))
{
success = 0;
break;
|| global_regs[new_reg + i]
/* Can't use regs which aren't saved by the prologue. */
|| (! df_regs_ever_live_p (new_reg + i)
- && ! call_used_regs[new_reg + i])
+ && ! call_used_or_fixed_reg_p (new_reg + i))
#ifdef LEAF_REGISTERS
/* We can't use a non-leaf register if we're in a
leaf function. */
if (regno >= 0 && regno < FIRST_PSEUDO_REGISTER)
for (i = 0; i < nregs; ++i)
- if (call_used_regs[regno + i]
+ if (call_used_or_fixed_reg_p (regno + i)
|| targetm.hard_regno_call_part_clobbered (NULL, regno + i,
mode))
return 0;
if (valueno >= 0 && valueno < FIRST_PSEUDO_REGISTER)
for (i = 0; i < valuenregs; ++i)
- if (call_used_regs[valueno + i]
+ if (call_used_or_fixed_reg_p (valueno + i)
|| targetm.hard_regno_call_part_clobbered (NULL, valueno + i,
mode))
return 0;
if (crtl->saves_all_registers)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
+ if (! call_used_or_fixed_reg_p (i)
+ && ! fixed_regs[i]
+ && ! LOCAL_REGNO (i))
df_set_regs_ever_live (i, true);
/* Find all the pseudo registers that didn't get hard regs
&& (inv_reg_alloc_order[regno]
< inv_reg_alloc_order[best_reg])
#else
- && call_used_regs[regno]
- && ! call_used_regs[best_reg]
+ && call_used_or_fixed_reg_p (regno)
+ && ! call_used_or_fixed_reg_p (best_reg)
#endif
))
{
CLEAR_HARD_REG_SET (sel_hrd.regs_ever_used);
for (cur_reg = 0; cur_reg < FIRST_PSEUDO_REGISTER; cur_reg++)
- if (df_regs_ever_live_p (cur_reg) || call_used_regs[cur_reg])
+ if (df_regs_ever_live_p (cur_reg) || call_used_or_fixed_reg_p (cur_reg))
SET_HARD_REG_BIT (sel_hrd.regs_ever_used, cur_reg);
/* Initialize registers that are valid based on mode when this is