Remove call_really_used_regs

After previous patches, it's now possible for call_used_regs to be
the "real" set of call-clobbered registers, without any special
handling for fixed registers.  This patch therefore removes the
separate call_really_used_regs and updates the targets that define
CALL_REALLY_USED_REGISTERS so that they handle call_used_regs in
the same way that they used to handle call_really_used_regs.

With this change, it's no longer necessary for targets that define
CALL_REALLY_USED_REGISTERS to define CALL_USED_REGISTER as well.

2019-09-10  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* 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.

From-SVN: r275605
This commit is contained in:
Richard Sandiford 2019-09-10 18:57:09 +00:00 committed by Richard Sandiford
parent 53bee79cab
commit d7fb4c3162
29 changed files with 214 additions and 438 deletions

View File

@ -1,3 +1,89 @@
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.

View File

@ -1655,7 +1655,7 @@ get_csky_live_regs (int *count)
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. */
@ -2074,7 +2074,6 @@ csky_conditional_register_usage (void)
{
fixed_regs[i] = 1;
call_used_regs[i] = 1;
call_really_used_regs[i] = 1;
}
}
/* For some targets, the high registers are not supported.
@ -2090,7 +2089,6 @@ csky_conditional_register_usage (void)
{
fixed_regs[i] = 1;
call_used_regs[i] = 1;
call_really_used_regs[i] = 1;
}
}
@ -2103,8 +2101,7 @@ csky_conditional_register_usage (void)
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. */
@ -2112,11 +2109,9 @@ csky_conditional_register_usage (void)
{
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. */
@ -2129,18 +2124,16 @@ csky_conditional_register_usage (void)
{
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;
}
}

View File

@ -428,34 +428,6 @@ extern int csky_arch_isa_features[];
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

View File

@ -6054,7 +6054,7 @@ fix_range (const char *const_str)
}
for (i = first; i <= last; ++i)
fixed_regs[i] = call_used_regs[i] = 1;
fixed_regs[i] = 1;
if (!comma)
break;

View File

@ -371,41 +371,6 @@ while (0)
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

View File

@ -1526,7 +1526,7 @@ static struct m32r_frame_info zero_frame_info;
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)
@ -2927,10 +2927,7 @@ static void
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

View File

@ -348,7 +348,7 @@
#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, \
@ -356,8 +356,6 @@
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). */

View File

@ -10636,7 +10636,7 @@ mips_global_pointer (void)
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;
@ -10789,7 +10789,7 @@ mips_interrupt_extra_call_saved_reg_p (unsigned int 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;
@ -10812,12 +10812,12 @@ mips_cfun_call_saved_reg_p (unsigned int regno)
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.
@ -20411,7 +20411,6 @@ mips_swap_registers (unsigned int i)
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
@ -20447,7 +20446,7 @@ mips_conditional_register_usage (void)
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)
{
@ -20462,25 +20461,25 @@ mips_conditional_register_usage (void)
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.
@ -20493,7 +20492,7 @@ mips_conditional_register_usage (void)
{
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. */
@ -20503,7 +20502,7 @@ mips_conditional_register_usage (void)
{
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. */

View File

@ -1817,29 +1817,6 @@ FP_ASM_SPEC "\
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, \

View File

@ -552,7 +552,7 @@ fp_regs_to_save (void)
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;
@ -640,7 +640,7 @@ mn10300_get_live_callee_saved_regs (unsigned int * bytes_saved)
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;
@ -878,7 +878,7 @@ mn10300_expand_prologue (void)
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. */
@ -902,7 +902,7 @@ mn10300_expand_prologue (void)
/* 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. */
@ -984,7 +984,7 @@ mn10300_expand_prologue (void)
/* 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;
@ -1118,7 +1118,7 @@ mn10300_expand_epilogue (void)
/* 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. */
@ -1186,7 +1186,7 @@ mn10300_expand_epilogue (void)
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;
@ -2830,17 +2830,16 @@ mn10300_conditional_register_usage (void)
{
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.

View File

@ -197,7 +197,7 @@ extern enum processor_type mn10300_tune_cpu;
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 */ \
@ -211,13 +211,6 @@ extern enum processor_type mn10300_tune_cpu;
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 \

View File

@ -8904,42 +8904,37 @@ rs6000_conditional_register_usage (void)
/* 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)
@ -8948,12 +8943,12 @@ rs6000_conditional_register_usage (void)
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;
}
}

View File

@ -882,31 +882,6 @@ enum data_align { align_abi, align_opt, align_both };
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').

View File

@ -9416,7 +9416,7 @@ s390_regs_ever_clobbered (char regs_ever_clobbered[])
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
@ -9438,7 +9438,7 @@ s390_regs_ever_clobbered (char regs_ever_clobbered[])
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)
@ -9552,7 +9552,7 @@ s390_register_info_gprtofpr ()
/* 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))
@ -9711,7 +9711,7 @@ s390_register_info ()
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)
@ -10269,7 +10269,7 @@ s390_hard_regno_rename_ok (unsigned int old_reg, unsigned int new_reg)
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;
@ -10284,7 +10284,7 @@ s390_hard_regno_scratch_ok (unsigned int regno)
{
/* 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;
@ -11129,10 +11129,10 @@ s390_emit_prologue (void)
/* 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;
}
@ -11585,7 +11585,7 @@ static void
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));
}
@ -11786,7 +11786,7 @@ s390_can_use_return_insn (void)
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;
@ -13543,36 +13543,31 @@ s390_conditional_register_usage (void)
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;
}
}
@ -13662,8 +13657,8 @@ s390_optimize_prologue (void)
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

View File

@ -453,22 +453,6 @@ extern const char *s390_host_detect_local_cpu (int argc, const char **argv);
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, \

View File

@ -6703,7 +6703,7 @@ output_stack_adjust (int size, rtx reg, int epilogue_p,
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)
{
@ -7009,7 +7009,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask)
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)
{
@ -7040,7 +7040,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask)
: 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))
@ -7053,7 +7053,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask)
: (/* 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)))
@ -8289,7 +8289,7 @@ sh_fix_range (const char *const_str)
}
for (int i = first; i <= last; ++i)
fixed_regs[i] = call_used_regs[i] = 1;
fixed_regs[i] = 1;
if (!comma)
break;
@ -8809,7 +8809,7 @@ reg_unused_after (rtx reg, rtx_insn *insn)
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;
@ -11447,32 +11447,28 @@ sh_conditional_register_usage (void)
{
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

View File

@ -732,45 +732,6 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
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

View File

@ -13008,10 +13008,7 @@ static void
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])

View File

@ -677,31 +677,6 @@ along with GCC; see the file COPYING3. If not see
\
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.

View File

@ -4341,20 +4341,11 @@ static void
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;
}

View File

@ -114,16 +114,13 @@
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, \

View File

@ -3864,20 +3864,11 @@ static void
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;
}

View File

@ -79,16 +79,13 @@
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, \

View File

@ -754,20 +754,20 @@ visium_conditional_register_usage (void)
{
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)
@ -781,8 +781,8 @@ visium_conditional_register_usage (void)
{
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;
}
}
}

View File

@ -488,27 +488,6 @@
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').

View File

@ -1878,6 +1878,9 @@ function calls.
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
@ -1887,8 +1890,9 @@ exit, if the register is used within the function.
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

View File

@ -1689,6 +1689,9 @@ function calls.
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
@ -1698,8 +1701,9 @@ exit, if the register is used within the function.
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

View File

@ -395,8 +395,6 @@ struct target_hard_regs {
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
@ -477,8 +475,6 @@ extern struct target_hard_regs *this_target_hard_regs;
#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 \

View File

@ -73,17 +73,13 @@ struct target_regs *this_target_regs = &default_target_regs;
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
@ -164,10 +160,6 @@ init_reg_sets (void)
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
@ -175,10 +167,6 @@ init_reg_sets (void)
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
@ -193,9 +181,6 @@ init_reg_sets (void)
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;
@ -211,14 +196,6 @@ save_register_info (void)
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);
@ -233,11 +210,6 @@ restore_register_info (void)
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;
@ -371,17 +343,7 @@ init_reg_sets_1 (void)
/* 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);
@ -411,7 +373,7 @@ init_reg_sets_1 (void)
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);
}
@ -713,10 +675,11 @@ fix_register (const char *name, int fixed, int call_used)
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
}
}
@ -772,9 +735,6 @@ globalize_reg (tree decl, int i)
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);