+2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ * doc/tm.texi.in: Document that exactly one of CALL_USED_REGISTERS
+ and CALL_REALLY_USED_REGISTERS must be defined, and that
+ CALL_REALLY_USED_REGISTERS is preferred.
+ * doc/tm.texi: Regenerate.
+ * hard-reg-set.h (target_hard_regs::x_call_really_used_regs): Delete.
+ (call_really_used_regs): Likewise.
+ * reginfo.c: Raise an #error if both CALL_USED_REGISTERS and
+ CALL_REALLY_USED_REGISTERS are defined.
+ (initial_call_used_regs): Use CALL_REALLY_USED_REGISTERS as the
+ initial value if defined.
+ (initial_call_really_used_regs): Delete.
+ (saved_call_really_used_regs): Likewise.
+ (CALL_REALLY_USED_REGNO_P): Likewise.
+ (init_reg_sets): Remove handling of call_really_used_regs.
+ (save_register_info, restore_register_info, globalize_reg): Likewise.
+ (init_reg_sets_1): Likewise. Use call_used_regs instead of
+ CALL_REALLY_USED_REGNO_P. Don't set call_used_regs for registers
+ outside operand_reg_set.
+ (fix_register): Don't change call_used_regs if
+ CALL_REALLY_USED_REGISTERS is defined.
+ * config/csky/csky.h (CALL_USED_REGISTERS): Delete.
+ * config/csky/csky.c (get_csky_live_regs): Use call_used_regs
+ instead of call_really_used_regs.
+ (csky_conditional_register_usage): Remove the old handling of
+ call_used_regs and change the handling of call_really_used_regs
+ to use call_used_regs instead.
+ * config/ia64/ia64.h (CALL_USED_REGISTERS): Delete.
+ * config/ia64/ia64.c (fix_range): Don't set call_used_regs when
+ making a register fixed.
+ * config/m32r/m32r.h (CALL_USED_REGISTERS): Delete.
+ * config/m32r/m32r.c (MUST_SAVE_REGISTER): Use call_used_regs
+ instead of call_really_used_regs.
+ (m32r_conditional_register_usage): Don't set call_used_regs when
+ making a register fixed.
+ * config/mips/mips.h (CALL_USED_REGISTERS): Delete.
+ * config/mips/mips.c (mips_global_pointer): Use call_used_regs
+ instead of call_really_used_regs.
+ (mips_interrupt_extra_call_saved_reg_p): Likewise.
+ (mips_cfun_call_saved_reg_p): Likewise.
+ (mips_swap_registers): Remove the old handling of call_used_regs
+ and change the handling of call_really_used_regs to use call_used_regs
+ instead.
+ (mips_conditional_register_usage): Likewise.
+ * config/mn10300/mn10300.h (CALL_USED_REGISTERS): Delete.
+ * config/mn10300/mn10300.c (fp_regs_to_save): Use call_used_regs
+ instead of call_really_used_regs.
+ (mn10300_get_live_callee_saved_regs): Likewise.
+ (mn10300_expand_prologue, mn10300_expand_epilogue): Likewise.
+ (mn10300_conditional_register_usage): Don't set call_used_regs when
+ making a register fixed.
+ * config/rs6000/rs6000.h (CALL_USED_REGISTERS): Delete.
+ * config/rs6000/rs6000.c (rs6000_conditional_register_usage):
+ Remove the old handling of call_used_regs and change the handling
+ of call_really_used_regs to use call_used_regs instead.
+ * config/s390/s390.h (CALL_USED_REGISTERS): Delete.
+ * config/s390/s390.c (s390_regs_ever_clobbered): Use call_used_regs
+ instead of call_really_used_regs.
+ (s390_register_info_gprtofpr, s390_register_info): Likewise.
+ (s390_hard_regno_rename_ok, s390_hard_regno_scratch_ok): Likewise.
+ (s390_emit_prologue, s300_set_up_by_prologue): Likewise.
+ (s390_can_use_return_insn, s390_optimize_prologue): Likewise.
+ (s390_conditional_register_usage): Remove the old handling of
+ call_used_regs and change the handling of call_really_used_regs
+ to use call_used_regs instead.
+ * config/sh/sh.h (CALL_USED_REGISTERS): Delete.
+ * config/sh/sh.c (output_stack_adjust, calc_live_regs): Likewise.
+ (sh_fix_range, reg_unused_after): Likewise.
+ (sh_conditional_register_usage): Remove the old handling of
+ call_used_regs and change the handling of call_really_used_regs
+ to use call_used_regs instead.
+ * config/sparc/sparc.h (CALL_USED_REGISTERS): Delete.
+ * config/sparc/sparc.c (sparc_conditional_register_usage): Don't set
+ call_used_regs when making a register fixed.
+ * config/tilegx/tilegx.h (CALL_USED_REGISTERS): Delete.
+ * config/tilegx/tilegx.c (tilegx_conditional_register_usage): Don't set
+ call_used_regs when making a register fixed.
+ * config/tilepro/tilepro.h (CALL_USED_REGISTERS): Delete.
+ * config/tilepro/tilepro.c (tilepro_conditional_register_usage): Don't
+ set call_used_regs when making a register fixed.
+ * config/visium/visium.h (CALL_USED_REGISTERS): Delete.
+ * config/visium/visium.c (visium_conditional_register_usage): Remove
+ the old handling of call_used_regs and change the handling of
+ call_really_used_regs to use call_used_regs instead.
+
2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
* hard-reg-set.h (call_used_regs): Only define if IN_TARGET_CODE.
break;
/* Caller-saved registers marked as used. */
- if (df_regs_ever_live_p (reg) && !call_really_used_regs[reg])
+ if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
save = true;
/* Frame pointer marked used. */
{
fixed_regs[i] = 1;
call_used_regs[i] = 1;
- call_really_used_regs[i] = 1;
}
}
/* For some targets, the high registers are not supported.
{
fixed_regs[i] = 1;
call_used_regs[i] = 1;
- call_really_used_regs[i] = 1;
}
}
if (CSKY_TARGET_ARCH (CK801) || CSKY_TARGET_ARCH (CK802))
{
fixed_regs[CSKY_LR_REGNUM] = 1;
- call_used_regs[CSKY_LR_REGNUM] = 1;
- call_really_used_regs[CSKY_LR_REGNUM] = 0;
+ call_used_regs[CSKY_LR_REGNUM] = 0;
}
/* The hi/lo registers are only supported in dsp mode. */
{
fixed_regs[CSKY_HI_REGNUM] = 1;
call_used_regs[CSKY_HI_REGNUM] = 1;
- call_really_used_regs[CSKY_HI_REGNUM] = 1;
fixed_regs[CSKY_LO_REGNUM] = 1;
call_used_regs[CSKY_LO_REGNUM] = 1;
- call_really_used_regs[CSKY_LO_REGNUM] = 1;
}
/* The V_REGS are only supported in hard float mode. */
{
fixed_regs[regno] = 1;
call_used_regs[regno] = 1;
- call_really_used_regs[regno] = 1;
}
}
/* In pic mode, the gb register is not available for register
allocation. Since gb is not clobbered by function
- calls, set its call_really_used_regs to 0. */
+ calls, set its call_used_regs to 0. */
if (flag_pic)
{
fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_really_used_regs[PIC_OFFSET_TABLE_REGNUM] = 0;
+ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 0;
}
}
1 \
}
-/* 1 for registers that is clobbered (in general) by function calls.
- If a register has 0, the compiler automatically saves it on
- function entry and restores it on function exit, if the register
- is used within the function. */
-#define CALL_USED_REGISTERS \
- /* r0 r1 r2 r3 r4 r5 r6 r7 */ \
-{ 1, 1, 1, 1, 0, 0, 0, 0, \
- /* r8 r9 r10 r11 r12 r13 r14 r15 */ \
- 0, 0, 0, 0, 1, 1, 1, 0, \
- /* r16 r17 r18 r19 r20 r21 r22 r23 */ \
- 0, 0, 1, 1, 1, 1, 1, 1, \
- /* r24 r25 r26 r27 r28 r29 r30 r31 */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- /* reserved c hi lo */ \
- 1, 1, 1, 1, \
- /* reserved */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- /* vr0 vr1 vr2 vr3 vr4 vr5 vr6 vr7 */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- /* vr8 vr9 vr10 vr11 vr12 vr13 vr14 vr15 */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- /* reserved */ \
- 1, 1, \
- /* epc */ \
- 1 \
-}
-
/* Like `CALL_USED_REGISTERS' but used to overcome a historical
problem which makes CALL_USED_REGISTERS *always* include
all the FIXED_REGISTERS. Until this problem has been
}
for (i = first; i <= last; ++i)
- fixed_regs[i] = call_used_regs[i] = 1;
+ fixed_regs[i] = 1;
if (!comma)
break;
1, 1, 1, 1, 1, 1 \
}
-/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered
- (in general) by function calls as well as for fixed registers. This
- macro therefore identifies the registers that are not available for
- general allocation of values that must live across function calls. */
-
-#define CALL_USED_REGISTERS \
-{ /* General registers. */ \
- 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
- /* Floating-point registers. */ \
- 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- /* Predicate registers. */ \
- 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- /* Branch registers. */ \
- 1, 0, 0, 0, 0, 0, 1, 1, \
- /*FP CCV UNAT PFS LC EC */ \
- 1, 1, 1, 1, 1, 1 \
-}
-
/* Like `CALL_USED_REGISTERS' but used to overcome a historical
problem which makes CALL_USED_REGISTERS *always* include
all the FIXED_REGISTERS. Until this problem has been
Don't consider them here. */
#define MUST_SAVE_REGISTER(regno, interrupt_p) \
((regno) != RETURN_ADDR_REGNUM && (regno) != FRAME_POINTER_REGNUM \
- && (df_regs_ever_live_p (regno) && (!call_really_used_regs[regno] || interrupt_p)))
+ && (df_regs_ever_live_p (regno) && (!call_used_regs[regno] || interrupt_p)))
#define MUST_SAVE_FRAME_POINTER (df_regs_ever_live_p (FRAME_POINTER_REGNUM))
#define MUST_SAVE_RETURN_ADDR (df_regs_ever_live_p (RETURN_ADDR_REGNUM) || crtl->profile)
m32r_conditional_register_usage (void)
{
if (flag_pic)
- {
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- }
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
}
/* Implement TARGET_LEGITIMATE_CONSTANT_P
#define SUBTARGET_CALL_USED_REGISTERS
#endif
-#define CALL_USED_REGISTERS \
+#define CALL_REALLY_USED_REGISTERS \
{ \
1, 1, 1, 1, 1, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 1, 1, \
SUBTARGET_CALL_USED_REGISTERS \
}
-#define CALL_REALLY_USED_REGISTERS CALL_USED_REGISTERS
-
/* If defined, an initializer for a vector of integers, containing the
numbers of hard registers in the order in which GCC should
prefer to use them (from most preferred to least). */
if (TARGET_CALL_SAVED_GP && crtl->is_leaf)
for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++)
if (!df_regs_ever_live_p (regno)
- && call_really_used_regs[regno]
+ && call_used_regs[regno]
&& !fixed_regs[regno]
&& regno != PIC_FUNCTION_ADDR_REGNUM)
return regno;
/* Otherwise, return true for registers that aren't ordinarily
call-clobbered. */
- return call_really_used_regs[regno];
+ return call_used_regs[regno];
}
return false;
return true;
/* call_insns preserve $28 unless they explicitly say otherwise,
- so call_really_used_regs[] treats $28 as call-saved. However,
+ so call_used_regs[] treats $28 as call-saved. However,
we want the ABI property rather than the default call_insn
property here. */
return (regno == GLOBAL_POINTER_REGNUM
? TARGET_CALL_SAVED_GP
- : !call_really_used_regs[regno]);
+ : !call_used_regs[regno]);
}
/* Return true if the function body might clobber register REGNO.
SWAP_INT (fixed_regs[i], fixed_regs[i + 1]);
SWAP_INT (call_used_regs[i], call_used_regs[i + 1]);
- SWAP_INT (call_really_used_regs[i], call_really_used_regs[i + 1]);
SWAP_STRING (reg_names[i], reg_names[i + 1]);
#undef SWAP_STRING
accessible_reg_set &= ~reg_class_contents[ST_REGS];
if (!ISA_HAS_CCF)
SET_HARD_REG_BIT (accessible_reg_set, FPSW_REGNUM);
- fixed_regs[FPSW_REGNUM] = call_used_regs[FPSW_REGNUM] = 1;
+ fixed_regs[FPSW_REGNUM] = 1;
}
if (TARGET_MIPS16)
{
and $25 (t9) because it is used as the function call address in
SVR4 PIC code. */
- fixed_regs[18] = call_used_regs[18] = 1;
- fixed_regs[19] = call_used_regs[19] = 1;
- fixed_regs[20] = call_used_regs[20] = 1;
- fixed_regs[21] = call_used_regs[21] = 1;
- fixed_regs[22] = call_used_regs[22] = 1;
- fixed_regs[23] = call_used_regs[23] = 1;
- fixed_regs[26] = call_used_regs[26] = 1;
- fixed_regs[27] = call_used_regs[27] = 1;
- fixed_regs[30] = call_used_regs[30] = 1;
+ fixed_regs[18] = 1;
+ fixed_regs[19] = 1;
+ fixed_regs[20] = 1;
+ fixed_regs[21] = 1;
+ fixed_regs[22] = 1;
+ fixed_regs[23] = 1;
+ fixed_regs[26] = 1;
+ fixed_regs[27] = 1;
+ fixed_regs[30] = 1;
if (optimize_size)
{
- fixed_regs[8] = call_used_regs[8] = 1;
- fixed_regs[9] = call_used_regs[9] = 1;
- fixed_regs[10] = call_used_regs[10] = 1;
- fixed_regs[11] = call_used_regs[11] = 1;
- fixed_regs[12] = call_used_regs[12] = 1;
- fixed_regs[13] = call_used_regs[13] = 1;
- fixed_regs[14] = call_used_regs[14] = 1;
- fixed_regs[15] = call_used_regs[15] = 1;
+ fixed_regs[8] = 1;
+ fixed_regs[9] = 1;
+ fixed_regs[10] = 1;
+ fixed_regs[11] = 1;
+ fixed_regs[12] = 1;
+ fixed_regs[13] = 1;
+ fixed_regs[14] = 1;
+ fixed_regs[15] = 1;
}
/* Do not allow HI and LO to be treated as register operands.
{
int regno;
for (regno = FP_REG_FIRST + 20; regno < FP_REG_FIRST + 24; regno++)
- call_really_used_regs[regno] = call_used_regs[regno] = 1;
+ call_used_regs[regno] = 1;
}
/* Odd registers in the range $f21-$f31 (inclusive) are call-clobbered
for n32 and o32 FP64. */
{
int regno;
for (regno = FP_REG_FIRST + 21; regno <= FP_REG_FIRST + 31; regno+=2)
- call_really_used_regs[regno] = call_used_regs[regno] = 1;
+ call_used_regs[regno] = 1;
}
/* Make sure that double-register accumulator values are correctly
ordered for the current endianness. */
called function in tact. EPILOGUE_USES says that $31 is useful
to the called function. */
-#define CALL_USED_REGISTERS \
-{ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- /* COP0 registers */ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- /* COP2 registers */ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- /* COP3 registers */ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
- /* 6 DSP accumulator registers & 6 control registers */ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
-}
-
-
-/* Define this since $28, though fixed, is call-saved in many ABIs. */
-
#define CALL_REALLY_USED_REGISTERS \
{ /* General registers. */ \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
return 0;
for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
- if (df_regs_ever_live_p (i) && ! call_really_used_regs[i])
+ if (df_regs_ever_live_p (i) && ! call_used_regs[i])
++n;
return n;
count = mask = 0;
for (i = 0; i <= LAST_EXTENDED_REGNUM; i++)
- if (df_regs_ever_live_p (i) && ! call_really_used_regs[i])
+ if (df_regs_ever_live_p (i) && ! call_used_regs[i])
{
mask |= (1 << i);
++ count;
frame pointer, size is nonzero and the user hasn't
changed the calling conventions of a0. */
if (! frame_pointer_needed && size
- && call_really_used_regs [FIRST_ADDRESS_REGNUM]
+ && call_used_regs[FIRST_ADDRESS_REGNUM]
&& ! fixed_regs[FIRST_ADDRESS_REGNUM])
{
/* Insn: add -(size + 4 * num_regs_to_save), sp. */
/* Consider alternative save_a0_no_merge if the user hasn't
changed the calling conventions of a0. */
- if (call_really_used_regs [FIRST_ADDRESS_REGNUM]
+ if (call_used_regs[FIRST_ADDRESS_REGNUM]
&& ! fixed_regs[FIRST_ADDRESS_REGNUM])
{
/* Insn: add -4 * num_regs_to_save, sp. */
/* Now actually save the FP registers. */
for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
- if (df_regs_ever_live_p (i) && ! call_really_used_regs [i])
+ if (df_regs_ever_live_p (i) && ! call_used_regs[i])
{
rtx addr;
/* Consider using a1 in post-increment mode, as long as the
user hasn't changed the calling conventions of a1. */
- if (call_really_used_regs [FIRST_ADDRESS_REGNUM + 1]
+ if (call_used_regs[FIRST_ADDRESS_REGNUM + 1]
&& ! fixed_regs[FIRST_ADDRESS_REGNUM+1])
{
/* Insn: mov sp,a1. */
reg = gen_rtx_POST_INC (SImode, reg);
for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
- if (df_regs_ever_live_p (i) && ! call_really_used_regs [i])
+ if (df_regs_ever_live_p (i) && ! call_used_regs[i])
{
rtx addr;
{
for (i = FIRST_EXTENDED_REGNUM;
i <= LAST_EXTENDED_REGNUM; i++)
- fixed_regs[i] = call_used_regs[i] = 1;
+ fixed_regs[i] = 1;
}
if (!TARGET_AM33_2)
{
for (i = FIRST_FP_REGNUM;
i <= LAST_FP_REGNUM; i++)
- fixed_regs[i] = call_used_regs[i] = 1;
+ fixed_regs[i] = 1;
}
if (flag_pic)
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] =
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
}
/* Worker function for TARGET_MD_ASM_ADJUST.
Aside from that, you can include as many other registers as you
like. */
-#define CALL_USED_REGISTERS \
+#define CALL_REALLY_USED_REGISTERS \
{ 1, 1, 0, 0, /* data regs */ \
1, 1, 0, 0, /* addr regs */ \
1, /* arg reg */ \
1 /* cc reg */ \
}
-/* Note: The definition of CALL_REALLY_USED_REGISTERS is not
- redundant. It is needed when compiling in PIC mode because
- the a2 register becomes fixed (and hence must be marked as
- call_used) but in order to preserve the ABI it is not marked
- as call_really_used. */
-#define CALL_REALLY_USED_REGISTERS CALL_USED_REGISTERS
-
#define REG_ALLOC_ORDER \
{ 0, 1, 4, 5, 2, 3, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 8, 9 \
, 42, 43, 44, 45, 46, 47, 48, 49, 34, 35, 36, 37, 38, 39, 40, 41 \
/* 64-bit AIX and Linux reserve GPR13 for thread-private data. */
if (TARGET_64BIT)
- fixed_regs[13] = call_used_regs[13]
- = call_really_used_regs[13] = 1;
+ fixed_regs[13] = call_used_regs[13] = 1;
/* Conditionally disable FPRs. */
if (TARGET_SOFT_FLOAT)
for (i = 32; i < 64; i++)
- fixed_regs[i] = call_used_regs[i]
- = call_really_used_regs[i] = 1;
+ fixed_regs[i] = call_used_regs[i] = 1;
/* The TOC register is not killed across calls in a way that is
visible to the compiler. */
if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
- call_really_used_regs[2] = 0;
+ call_used_regs[2] = 0;
if (DEFAULT_ABI == ABI_V4 && flag_pic == 2)
fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
if (DEFAULT_ABI == ABI_V4 && flag_pic == 1)
fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
- = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
- = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+ = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
if (DEFAULT_ABI == ABI_DARWIN && flag_pic)
fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
- = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
- = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+ = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
if (TARGET_TOC && TARGET_MINIMAL_TOC)
- fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
- = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+ fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
if (!TARGET_ALTIVEC && !TARGET_VSX)
{
for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)
- fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
- call_really_used_regs[VRSAVE_REGNO] = 1;
+ fixed_regs[i] = call_used_regs[i] = 1;
+ call_used_regs[VRSAVE_REGNO] = 1;
}
if (TARGET_ALTIVEC || TARGET_VSX)
if (TARGET_ALTIVEC_ABI)
{
for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)
- call_used_regs[i] = call_really_used_regs[i] = 1;
+ call_used_regs[i] = 1;
/* AIX reserves VR20:31 in non-extended ABI mode. */
if (TARGET_XCOFF)
for (i = FIRST_ALTIVEC_REGNO + 20; i < FIRST_ALTIVEC_REGNO + 32; ++i)
- fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
+ fixed_regs[i] = call_used_regs[i] = 1;
}
}
1, 1, 1 \
}
-/* 1 for registers not available across function calls.
- These must include the FIXED_REGISTERS and also any
- registers that can be used without being saved.
- The latter must include the registers where values are returned
- and the register where structure-value addresses are passed.
- Aside from that, you can include as many other registers as you like. */
-
-#define CALL_USED_REGISTERS \
- {/* GPRs */ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- /* FPRs */ \
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- /* VRs */ \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- /* lr ctr ca ap */ \
- 1, 1, 1, 1, \
- /* cr0..cr7 */ \
- 1, 1, 0, 0, 0, 1, 1, 1, \
- /* vrsave vscr sfp */ \
- 1, 1, 1 \
-}
-
/* Like `CALL_USED_REGISTERS' except this macro doesn't require that
the entire set of `FIXED_REGISTERS' be included.
(`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS').
if (!crtl->is_leaf)
{
for (i = 0; i < 32; i++)
- regs_ever_clobbered[i] = call_really_used_regs[i];
+ regs_ever_clobbered[i] = call_used_regs[i];
}
/* Make the "magic" eh_return registers live if necessary. For regs_ever_live
reload. */
if (crtl->saves_all_registers)
for (i = 0; i < 32; i++)
- if (!call_really_used_regs[i])
+ if (!call_used_regs[i])
regs_ever_clobbered[i] = 1;
FOR_EACH_BB_FN (cur_bb, cfun)
/* Advance to the next FP register which can be used as a
GPR save slot. */
- while ((!call_really_used_regs[save_reg_slot]
+ while ((!call_used_regs[save_reg_slot]
|| df_regs_ever_live_p (save_reg_slot)
|| cfun_fpr_save_p (save_reg_slot))
&& FP_REGNO_P (save_reg_slot))
cfun_frame_layout.fpr_bitmap = 0;
cfun_frame_layout.high_fprs = 0;
for (i = FPR0_REGNUM; i <= FPR15_REGNUM; i++)
- if (clobbered_regs[i] && !call_really_used_regs[i])
+ if (clobbered_regs[i] && !call_used_regs[i])
{
cfun_set_fpr_save (i);
if (i >= FPR8_REGNUM)
df_regs_ever_live. Since we have our own routine we have to tell
regrename manually about it. */
if (GENERAL_REGNO_P (new_reg)
- && !call_really_used_regs[new_reg]
+ && !call_used_regs[new_reg]
&& cfun_gpr_save_slot (new_reg) == SAVE_SLOT_NONE)
return false;
{
/* See s390_hard_regno_rename_ok. */
if (GENERAL_REGNO_P (regno)
- && !call_really_used_regs[regno]
+ && !call_used_regs[regno]
&& cfun_gpr_save_slot (regno) == SAVE_SLOT_NONE)
return false;
/* If f4 and f6 are call clobbered they are saved due to
stdargs and therefore are not frame related. */
- if (!call_really_used_regs[i])
+ if (!call_used_regs[i])
RTX_FRAME_RELATED_P (insn) = 1;
}
- else if (!TARGET_PACKED_STACK || call_really_used_regs[i])
+ else if (!TARGET_PACKED_STACK || call_used_regs[i])
offset += 8;
}
s300_set_up_by_prologue (hard_reg_set_container *regs)
{
if (cfun->machine->base_reg
- && !call_really_used_regs[REGNO (cfun->machine->base_reg)])
+ && !call_used_regs[REGNO (cfun->machine->base_reg)])
SET_HARD_REG_BIT (regs->set, REGNO (cfun->machine->base_reg));
}
return false;
if (cfun->machine->base_reg
- && !call_really_used_regs[REGNO (cfun->machine->base_reg)])
+ && !call_used_regs[REGNO (cfun->machine->base_reg)])
return false;
return cfun_frame_layout.frame_size == 0;
int i;
if (flag_pic)
- {
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- }
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
fixed_regs[BASE_REGNUM] = 0;
- call_used_regs[BASE_REGNUM] = 0;
fixed_regs[RETURN_REGNUM] = 0;
- call_used_regs[RETURN_REGNUM] = 0;
if (TARGET_64BIT)
{
for (i = FPR8_REGNUM; i <= FPR15_REGNUM; i++)
- call_used_regs[i] = call_really_used_regs[i] = 0;
+ call_used_regs[i] = 0;
}
else
{
- call_used_regs[FPR4_REGNUM] = call_really_used_regs[FPR4_REGNUM] = 0;
- call_used_regs[FPR6_REGNUM] = call_really_used_regs[FPR6_REGNUM] = 0;
+ call_used_regs[FPR4_REGNUM] = 0;
+ call_used_regs[FPR6_REGNUM] = 0;
}
if (TARGET_SOFT_FLOAT)
{
for (i = FPR0_REGNUM; i <= FPR15_REGNUM; i++)
- call_used_regs[i] = fixed_regs[i] = 1;
+ fixed_regs[i] = 1;
}
/* Disable v16 - v31 for non-vector target. */
if (!TARGET_VX)
{
for (i = VR16_REGNUM; i <= VR31_REGNUM; i++)
- fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
+ fixed_regs[i] = call_used_regs[i] = 1;
}
}
fpr_regno = FP_REGNO_P (src_regno) ? src_regno : dest_regno;
/* GPR must be call-saved, FPR must be call-clobbered. */
- if (!call_really_used_regs[fpr_regno]
- || call_really_used_regs[gpr_regno])
+ if (!call_used_regs[fpr_regno]
+ || call_used_regs[gpr_regno])
continue;
/* It must not happen that what we once saved in an FPR now
0, 0, 0, 0, \
0, 0, 0, 0 }
-#define CALL_USED_REGISTERS \
-{ 1, 1, 1, 1, \
- 1, 1, 0, 0, \
- 0, 0, 0, 0, \
- 0, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1, \
- 1, 1, 1, 1 }
-
#define CALL_REALLY_USED_REGISTERS \
{ 1, 1, 1, 1, /* r0 - r15 */ \
1, 1, 0, 0, \
to handle this case, so just die when we see it. */
if (epilogue_p < 0
|| current_function_interrupt
- || ! call_really_used_regs[temp] || fixed_regs[temp])
+ || ! call_used_regs[temp] || fixed_regs[temp])
temp = -1;
if (temp < 0 && ! current_function_interrupt && epilogue_p >= 0)
{
else if (TARGET_FPU_DOUBLE && TARGET_FMOVD && TARGET_FPU_SINGLE)
for (int count = 0, reg = FIRST_FP_REG; reg <= LAST_FP_REG; reg += 2)
if (df_regs_ever_live_p (reg) && df_regs_ever_live_p (reg+1)
- && (! call_really_used_regs[reg]
+ && (! call_used_regs[reg]
|| interrupt_handler)
&& ++count > 2)
{
: interrupt_handler
? (/* Need to save all the regs ever live. */
(df_regs_ever_live_p (reg)
- || (call_really_used_regs[reg]
+ || (call_used_regs[reg]
&& (! fixed_regs[reg] || reg == MACH_REG || reg == MACL_REG
|| reg == PIC_OFFSET_TABLE_REGNUM)
&& has_call))
: (/* Only push those regs which are used and need to be saved. */
(false)
|| (df_regs_ever_live_p (reg)
- && ((!call_really_used_regs[reg]
+ && ((!call_used_regs[reg]
&& !(reg != PIC_OFFSET_TABLE_REGNUM
&& fixed_regs[reg]
&& call_used_or_fixed_reg_p (reg)))
}
for (int i = first; i <= last; ++i)
- fixed_regs[i] = call_used_regs[i] = 1;
+ fixed_regs[i] = 1;
if (!comma)
break;
if (set == NULL && reg_overlap_mentioned_p (reg, PATTERN (insn)))
return false;
- if (code == CALL_INSN && call_really_used_regs[REGNO (reg)])
+ if (code == CALL_INSN && call_used_regs[REGNO (reg)])
return true;
}
return true;
{
for (int regno = 0; regno < FIRST_PSEUDO_REGISTER; regno ++)
if (! VALID_REGISTER_P (regno))
- fixed_regs[regno] = call_used_regs[regno] = 1;
+ fixed_regs[regno] = 1;
/* R8 and R9 are call-clobbered on SH5, but not on earlier SH ABIs. */
if (flag_pic)
- {
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- }
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
if (TARGET_FDPIC)
{
fixed_regs[PIC_REG] = 1;
call_used_regs[PIC_REG] = 1;
- call_really_used_regs[PIC_REG] = 1;
}
/* Renesas saves and restores mac registers on call. */
if (TARGET_HITACHI && ! TARGET_NOMACSAVE)
{
- call_really_used_regs[MACH_REG] = 0;
- call_really_used_regs[MACL_REG] = 0;
+ call_used_regs[MACH_REG] = 0;
+ call_used_regs[MACL_REG] = 0;
}
for (int regno = FIRST_GENERAL_REG; regno <= LAST_GENERAL_REG; regno++)
- if (! fixed_regs[regno] && call_really_used_regs[regno])
+ if (! fixed_regs[regno] && call_used_regs[regno])
SET_HARD_REG_BIT (reg_class_contents[SIBCALL_REGS], regno);
- call_really_used_regs[FPSCR_MODES_REG] = 0;
- call_really_used_regs[FPSCR_STAT_REG] = 0;
+ call_used_regs[FPSCR_MODES_REG] = 0;
+ call_used_regs[FPSCR_STAT_REG] = 0;
}
/* Implement TARGET_LEGITIMATE_CONSTANT_P
1, 1, 1, 1, \
}
-/* 1 for registers not available across function calls.
- These must include the FIXED_REGISTERS and also any
- registers that can be used without being saved.
- The latter must include the registers where values are returned
- and the register where structure-value addresses are passed.
- Aside from that, you can include as many other registers as you like. */
-#define CALL_USED_REGISTERS \
-{ \
-/* Regular registers. */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- /* R8 and R9 are call-clobbered on SH5, but not on earlier SH ABIs. \
- Only the lower 32bits of R10-R14 are guaranteed to be preserved \
- across SH5 function calls. */ \
- 0, 0, 0, 0, 0, 0, 0, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 0, 0, 0, 0, \
- 0, 0, 0, 0, 1, 1, 1, 1, \
- 1, 1, 1, 1, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 1, 1, 1, 1, \
-/* FP registers. */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 0, 0, 0, 0, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
-/* Branch target registers. */ \
- 1, 1, 1, 1, 1, 0, 0, 0, \
-/* XD registers. */ \
- 1, 1, 1, 1, 1, 1, 0, 0, \
-/*"gbr", "ap", "pr", "t", "mach", "macl", "fpul", "fpscr", */ \
- 1, 1, 1, 1, 1, 1, 1, 1, \
-/*"rap", "sfp","fpscr0","fpscr1" */ \
- 1, 1, 1, 1, \
-}
-
/* CALL_REALLY_USED_REGISTERS is used as a default setting, which is then
overridden by -fcall-saved-* and -fcall-used-* options and then by
TARGET_CONDITIONAL_REGISTER_USAGE. There we might want to make a
sparc_conditional_register_usage (void)
{
if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
- {
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- }
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
/* If the user has passed -f{fixed,call-{used,saved}}-g5 */
/* then honor it. */
if (TARGET_ARCH32 && fixed_regs[5])
\
0, 0, 0, 0, 1, 1, 1}
-/* 1 for registers not available across function calls.
- These must include the FIXED_REGISTERS and also any
- registers that can be used without being saved.
- The latter must include the registers where values are returned
- and the register where structure-value addresses are passed.
- Aside from that, you can include as many other registers as you like. */
-
-#define CALL_USED_REGISTERS \
- {1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 1, \
- \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- 1, 1, 1, 1, 1, 1, 1, 1, \
- \
- 1, 1, 1, 1, 1, 1, 1}
-
/* 1 for registers not available across function calls.
Unlike the above, this need not include the FIXED_REGISTERS, but any
registers that can be used without being saved.
tilegx_conditional_register_usage (void)
{
global_regs[TILEGX_NETORDER_REGNUM] = 1;
- /* TILEGX_PIC_TEXT_LABEL_REGNUM is conditionally used. It is a
- member of fixed_regs, and therefore must be member of
- call_used_regs, but it is not a member of call_really_used_regs[]
- because it is not clobbered by a call. */
+ /* TILEGX_PIC_TEXT_LABEL_REGNUM is conditionally used. */
if (TILEGX_PIC_TEXT_LABEL_REGNUM != INVALID_REGNUM)
- {
- fixed_regs[TILEGX_PIC_TEXT_LABEL_REGNUM] = 1;
- call_used_regs[TILEGX_PIC_TEXT_LABEL_REGNUM] = 1;
- }
+ fixed_regs[TILEGX_PIC_TEXT_LABEL_REGNUM] = 1;
if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
- {
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- }
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
}
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1}
-#define CALL_USED_REGISTERS \
+#define CALL_REALLY_USED_REGISTERS \
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1}
-#define CALL_REALLY_USED_REGISTERS \
- CALL_USED_REGISTERS
-
#define REG_ALLOC_ORDER { \
10, 11, 12, 13, 14, /* call used */ \
15, 16, 17, 18, 19, \
tilepro_conditional_register_usage (void)
{
global_regs[TILEPRO_NETORDER_REGNUM] = 1;
- /* TILEPRO_PIC_TEXT_LABEL_REGNUM is conditionally used. It is a
- member of fixed_regs, and therefore must be member of
- call_used_regs, but it is not a member of call_really_used_regs[]
- because it is not clobbered by a call. */
+ /* TILEPRO_PIC_TEXT_LABEL_REGNUM is conditionally used. */
if (TILEPRO_PIC_TEXT_LABEL_REGNUM != INVALID_REGNUM)
- {
- fixed_regs[TILEPRO_PIC_TEXT_LABEL_REGNUM] = 1;
- call_used_regs[TILEPRO_PIC_TEXT_LABEL_REGNUM] = 1;
- }
+ fixed_regs[TILEPRO_PIC_TEXT_LABEL_REGNUM] = 1;
if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
- {
- fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
- }
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
}
0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1}
-#define CALL_USED_REGISTERS \
+#define CALL_REALLY_USED_REGISTERS \
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1}
-#define CALL_REALLY_USED_REGISTERS \
- CALL_USED_REGISTERS
-
#define REG_ALLOC_ORDER { \
10, 11, 12, 13, 14, /* call used */ \
15, 16, 17, 18, 19, \
{
if (visium_cpu_and_features == PROCESSOR_GR5)
{
- fixed_regs[24] = call_used_regs[24] = 1;
- fixed_regs[25] = call_used_regs[25] = 1;
- fixed_regs[26] = call_used_regs[26] = 1;
- fixed_regs[27] = call_used_regs[27] = 1;
- fixed_regs[28] = call_used_regs[28] = 1;
- call_really_used_regs[24] = 0;
- call_really_used_regs[25] = 0;
- call_really_used_regs[26] = 0;
- call_really_used_regs[27] = 0;
- call_really_used_regs[28] = 0;
+ fixed_regs[24] = 1;
+ fixed_regs[25] = 1;
+ fixed_regs[26] = 1;
+ fixed_regs[27] = 1;
+ fixed_regs[28] = 1;
+ call_used_regs[24] = 0;
+ call_used_regs[25] = 0;
+ call_used_regs[26] = 0;
+ call_used_regs[27] = 0;
+ call_used_regs[28] = 0;
}
- fixed_regs[31] = call_used_regs[31] = 1;
- call_really_used_regs[31] = 0;
+ fixed_regs[31] = 1;
+ call_used_regs[31] = 0;
/* We also need to change the long-branch register. */
if (visium_cpu_and_features == PROCESSOR_GR5)
{
for (int i = FP_FIRST_REGNUM; i <= FP_LAST_REGNUM; i++)
{
- fixed_regs[i] = call_used_regs[i] = 1;
- call_really_used_regs[i] = 0;
+ fixed_regs[i] = 1;
+ call_used_regs[i] = 0;
}
}
}
0, 0, 0, 0, 0, 0, 0, 0, /* f8 .. f15 */ \
1, 1, 1 } /* flags, arg, frame */
-/* `CALL_USED_REGISTERS'
-
- Like `FIXED_REGISTERS' but has 1 for each register that is
- clobbered (in general) by function calls as well as for fixed
- registers. This macro therefore identifies the registers that are
- not available for general allocation of values that must live
- across function calls.
-
- If a register has 0 in `CALL_USED_REGISTERS', the compiler
- automatically saves it on function entry and restores it on
- function exit, if the register is used within the function. */
-#define CALL_USED_REGISTERS \
- { 1, 1, 1, 1, 1, 1, 1, 1, /* r0 .. r7 */ \
- 1, 1, 1, 0, 0, 0, 0, 0, /* r8 .. r15 */ \
- 0, 0, 0, 0, 1, 1, 0, 1, /* r16 .. r23 */ \
- 1, 1, 1, 1, 1, 1, 1, 1, /* r24 .. r31 */ \
- 1, 1, /* mdb, mdc */ \
- 1, 1, 1, 1, 1, 1, 1, 1, /* f0 .. f7 */ \
- 1, 0, 0, 0, 0, 0, 0, 0, /* f8 .. f15 */ \
- 1, 1, 1 } /* flags, arg, frame */
-
/* Like `CALL_USED_REGISTERS' except this macro doesn't require that
the entire set of `FIXED_REGISTERS' be included.
(`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS').
If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
+
+Exactly one of @code{CALL_USED_REGISTERS} and @code{CALL_REALLY_USED_REGISTERS}
+must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}.
@end defmac
@defmac CALL_REALLY_USED_REGISTERS
Like @code{CALL_USED_REGISTERS} except this macro doesn't require
that the entire set of @code{FIXED_REGISTERS} be included.
(@code{CALL_USED_REGISTERS} must be a superset of @code{FIXED_REGISTERS}).
-This macro is optional. If not specified, it defaults to the value
-of @code{CALL_USED_REGISTERS}.
+
+Exactly one of @code{CALL_USED_REGISTERS} and @code{CALL_REALLY_USED_REGISTERS}
+must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}.
@end defmac
@cindex call-used register
If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
+
+Exactly one of @code{CALL_USED_REGISTERS} and @code{CALL_REALLY_USED_REGISTERS}
+must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}.
@end defmac
@defmac CALL_REALLY_USED_REGISTERS
Like @code{CALL_USED_REGISTERS} except this macro doesn't require
that the entire set of @code{FIXED_REGISTERS} be included.
(@code{CALL_USED_REGISTERS} must be a superset of @code{FIXED_REGISTERS}).
-This macro is optional. If not specified, it defaults to the value
-of @code{CALL_USED_REGISTERS}.
+
+Exactly one of @code{CALL_USED_REGISTERS} and @code{CALL_REALLY_USED_REGISTERS}
+must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}.
@end defmac
@cindex call-used register
a pseudo reg whose life crosses calls. */
char x_call_used_regs[FIRST_PSEUDO_REGISTER];
- char x_call_really_used_regs[FIRST_PSEUDO_REGISTER];
-
/* For targets that use reload rather than LRA, this is the set
of registers that we are able to save and restore around calls
(i.e. those for which we know a suitable mode and set of
#define call_used_regs \
(this_target_hard_regs->x_call_used_regs)
#endif
-#define call_really_used_regs \
- (this_target_hard_regs->x_call_really_used_regs)
#define savable_regs \
(this_target_hard_regs->x_savable_regs)
#define regs_invalidated_by_call \
static const char initial_fixed_regs[] = FIXED_REGISTERS;
/* Data for initializing call_used_regs. */
-static const char initial_call_used_regs[] = CALL_USED_REGISTERS;
-
#ifdef CALL_REALLY_USED_REGISTERS
-/* Data for initializing call_really_used_regs. */
-static const char initial_call_really_used_regs[] = CALL_REALLY_USED_REGISTERS;
+#ifdef CALL_USED_REGISTERS
+#error CALL_USED_REGISTERS and CALL_REALLY_USED_REGISTERS are both defined
#endif
-
-#ifdef CALL_REALLY_USED_REGISTERS
-#define CALL_REALLY_USED_REGNO_P(X) call_really_used_regs[X]
+static const char initial_call_used_regs[] = CALL_REALLY_USED_REGISTERS;
#else
-#define CALL_REALLY_USED_REGNO_P(X) call_used_regs[X]
+static const char initial_call_used_regs[] = CALL_USED_REGISTERS;
#endif
/* Indexed by hard register number, contains 1 for registers
CALL_USED_REGISTERS had the right number of initializers. */
gcc_assert (sizeof fixed_regs == sizeof initial_fixed_regs);
gcc_assert (sizeof call_used_regs == sizeof initial_call_used_regs);
-#ifdef CALL_REALLY_USED_REGISTERS
- gcc_assert (sizeof call_really_used_regs
- == sizeof initial_call_really_used_regs);
-#endif
#ifdef REG_ALLOC_ORDER
gcc_assert (sizeof reg_alloc_order == sizeof initial_reg_alloc_order);
#endif
memcpy (fixed_regs, initial_fixed_regs, sizeof fixed_regs);
memcpy (call_used_regs, initial_call_used_regs, sizeof call_used_regs);
-#ifdef CALL_REALLY_USED_REGISTERS
- memcpy (call_really_used_regs, initial_call_really_used_regs,
- sizeof call_really_used_regs);
-#endif
#ifdef REG_ALLOC_ORDER
memcpy (reg_alloc_order, initial_reg_alloc_order, sizeof reg_alloc_order);
#endif
subsequent back-end reinitialization. */
static char saved_fixed_regs[FIRST_PSEUDO_REGISTER];
static char saved_call_used_regs[FIRST_PSEUDO_REGISTER];
-#ifdef CALL_REALLY_USED_REGISTERS
-static char saved_call_really_used_regs[FIRST_PSEUDO_REGISTER];
-#endif
static const char *saved_reg_names[FIRST_PSEUDO_REGISTER];
static HARD_REG_SET saved_accessible_reg_set;
static HARD_REG_SET saved_operand_reg_set;
memcpy (saved_fixed_regs, fixed_regs, sizeof fixed_regs);
memcpy (saved_call_used_regs, call_used_regs, sizeof call_used_regs);
- /* Likewise for call_really_used_regs. */
-#ifdef CALL_REALLY_USED_REGISTERS
- gcc_assert (sizeof call_really_used_regs
- == sizeof saved_call_really_used_regs);
- memcpy (saved_call_really_used_regs, call_really_used_regs,
- sizeof call_really_used_regs);
-#endif
-
/* And similarly for reg_names. */
gcc_assert (sizeof reg_names == sizeof saved_reg_names);
memcpy (saved_reg_names, reg_names, sizeof reg_names);
memcpy (fixed_regs, saved_fixed_regs, sizeof fixed_regs);
memcpy (call_used_regs, saved_call_used_regs, sizeof call_used_regs);
-#ifdef CALL_REALLY_USED_REGISTERS
- memcpy (call_really_used_regs, saved_call_really_used_regs,
- sizeof call_really_used_regs);
-#endif
-
memcpy (reg_names, saved_reg_names, sizeof reg_names);
accessible_reg_set = saved_accessible_reg_set;
operand_reg_set = saved_operand_reg_set;
/* If a register is too limited to be treated as a register operand,
then it should never be allocated to a pseudo. */
if (!TEST_HARD_REG_BIT (operand_reg_set, i))
- {
- fixed_regs[i] = 1;
- call_used_regs[i] = 1;
- }
-
- /* call_used_regs must include fixed_regs. */
- gcc_assert (!fixed_regs[i] || call_used_regs[i]);
-#ifdef CALL_REALLY_USED_REGISTERS
- /* call_used_regs must include call_really_used_regs. */
- gcc_assert (!call_really_used_regs[i] || call_used_regs[i]);
-#endif
+ fixed_regs[i] = 1;
if (fixed_regs[i])
SET_HARD_REG_BIT (fixed_reg_set, i);
else if (!PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
&& i == (unsigned) PIC_OFFSET_TABLE_REGNUM && fixed_regs[i])
;
- else if (CALL_REALLY_USED_REGNO_P (i))
+ else if (call_used_regs[i])
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
}
else
{
fixed_regs[i] = fixed;
- call_used_regs[i] = call_used;
#ifdef CALL_REALLY_USED_REGISTERS
if (fixed == 0)
- call_really_used_regs[i] = call_used;
+ call_used_regs[i] = call_used;
+#else
+ call_used_regs[i] = call_used;
#endif
}
}
return;
fixed_regs[i] = call_used_regs[i] = 1;
-#ifdef CALL_REALLY_USED_REGISTERS
- call_really_used_regs[i] = 1;
-#endif
SET_HARD_REG_BIT (fixed_reg_set, i);