reduce conditional compilation for HARD_FRAME_POINTER_IS_FRAME_POINTER

gcc/ChangeLog:

2015-04-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* alias.c (init_alias_target): Remove ifdef
	* HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* df-scan.c (df_insn_refs_collect): Likewise.
	(df_get_regular_block_artificial_uses): Likewise.
	(df_get_eh_block_artificial_uses): Likewise.
	(df_get_entry_block_def_set): Likewise.
	(df_get_exit_block_use_set): Likewise.
	* emit-rtl.c (gen_rtx_REG): Likewise.
	* ira.c (ira_setup_eliminable_regset): Likewise.
	* reginfo.c (init_reg_sets_1): Likewise.
	* regrename.c (rename_chains): Likewise.
	* reload1.c (reload): Likewise.
	(eliminate_regs_in_insn): Likewise.
	* resource.c (mark_referenced_resources): Likewise.
	(init_resource_info): Likewise.

From-SVN: r222300
This commit is contained in:
Trevor Saunders 2015-04-22 00:44:54 +00:00 committed by Trevor Saunders
parent cbc7d031c4
commit c3e080363d
9 changed files with 66 additions and 54 deletions

View File

@ -1,3 +1,21 @@
2015-04-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* alias.c (init_alias_target): Remove ifdef
* HARD_FRAME_POINTER_IS_FRAME_POINTER.
* df-scan.c (df_insn_refs_collect): Likewise.
(df_get_regular_block_artificial_uses): Likewise.
(df_get_eh_block_artificial_uses): Likewise.
(df_get_entry_block_def_set): Likewise.
(df_get_exit_block_use_set): Likewise.
* emit-rtl.c (gen_rtx_REG): Likewise.
* ira.c (ira_setup_eliminable_regset): Likewise.
* reginfo.c (init_reg_sets_1): Likewise.
* regrename.c (rename_chains): Likewise.
* reload1.c (reload): Likewise.
(eliminate_regs_in_insn): Likewise.
* resource.c (mark_referenced_resources): Likewise.
(init_resource_info): Likewise.
2015-04-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (MASK_RETURN_ADDR): New definition.

View File

@ -2765,10 +2765,9 @@ init_alias_target (void)
= unique_base_value (UNIQUE_BASE_VALUE_ARGP);
static_reg_base_value[FRAME_POINTER_REGNUM]
= unique_base_value (UNIQUE_BASE_VALUE_FP);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
static_reg_base_value[HARD_FRAME_POINTER_REGNUM]
= unique_base_value (UNIQUE_BASE_VALUE_HFP);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
static_reg_base_value[HARD_FRAME_POINTER_REGNUM]
= unique_base_value (UNIQUE_BASE_VALUE_HFP);
}
/* Set MEMORY_MODIFIED when X modifies DATA (that is assumed

View File

@ -3247,12 +3247,11 @@ df_insn_refs_collect (struct df_collection_rec *collection_rec,
regno_reg_rtx[FRAME_POINTER_REGNUM],
NULL, bb, insn_info,
DF_REF_REG_USE, 0);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
df_ref_record (DF_REF_BASE, collection_rec,
regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
NULL, bb, insn_info,
DF_REF_REG_USE, 0);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
df_ref_record (DF_REF_BASE, collection_rec,
regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
NULL, bb, insn_info,
DF_REF_REG_USE, 0);
break;
default:
break;
@ -3442,9 +3441,9 @@ df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses)
reference of the frame pointer. */
bitmap_set_bit (regular_block_artificial_uses, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
bitmap_set_bit (regular_block_artificial_uses, HARD_FRAME_POINTER_REGNUM);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
bitmap_set_bit (regular_block_artificial_uses,
HARD_FRAME_POINTER_REGNUM);
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
@ -3494,9 +3493,9 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses)
if (frame_pointer_needed)
{
bitmap_set_bit (eh_block_artificial_uses, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
bitmap_set_bit (eh_block_artificial_uses, HARD_FRAME_POINTER_REGNUM);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
bitmap_set_bit (eh_block_artificial_uses,
HARD_FRAME_POINTER_REGNUM);
}
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
if (fixed_regs[ARG_POINTER_REGNUM])
@ -3580,11 +3579,11 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
/* Any reference to any pseudo before reload is a potential
reference of the frame pointer. */
bitmap_set_bit (entry_block_defs, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
/* If they are different, also mark the hard frame pointer as live. */
if (!LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
&& !LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
bitmap_set_bit (entry_block_defs, HARD_FRAME_POINTER_REGNUM);
#endif
}
/* These registers are live everywhere. */
@ -3718,11 +3717,11 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
if ((!reload_completed) || frame_pointer_needed)
{
bitmap_set_bit (exit_block_uses, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
/* If they are different, also mark the hard frame pointer as live. */
if (!LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
&& !LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
bitmap_set_bit (exit_block_uses, HARD_FRAME_POINTER_REGNUM);
#endif
}
/* Many architectures have a GP register even without flag_pic.

View File

@ -715,11 +715,11 @@ gen_rtx_REG (machine_mode mode, unsigned int regno)
if (regno == FRAME_POINTER_REGNUM
&& (!reload_completed || frame_pointer_needed))
return frame_pointer_rtx;
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
if (regno == HARD_FRAME_POINTER_REGNUM
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
&& regno == HARD_FRAME_POINTER_REGNUM
&& (!reload_completed || frame_pointer_needed))
return hard_frame_pointer_rtx;
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && !HARD_FRAME_POINTER_IS_ARG_POINTER
if (regno == ARG_POINTER_REGNUM)
return arg_pointer_rtx;

View File

@ -2341,19 +2341,20 @@ ira_setup_eliminable_regset (void)
else
df_set_regs_ever_live (eliminables[i].from, true);
}
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM))
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
{
SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM);
if (frame_pointer_needed)
SET_HARD_REG_BIT (ira_no_alloc_regs, HARD_FRAME_POINTER_REGNUM);
if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM))
{
SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM);
if (frame_pointer_needed)
SET_HARD_REG_BIT (ira_no_alloc_regs, HARD_FRAME_POINTER_REGNUM);
}
else if (frame_pointer_needed)
error ("%s cannot be used in asm here",
reg_names[HARD_FRAME_POINTER_REGNUM]);
else
df_set_regs_ever_live (HARD_FRAME_POINTER_REGNUM, true);
}
else if (frame_pointer_needed)
error ("%s cannot be used in asm here",
reg_names[HARD_FRAME_POINTER_REGNUM]);
else
df_set_regs_ever_live (HARD_FRAME_POINTER_REGNUM, true);
#endif
#else
if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM))

View File

@ -461,10 +461,9 @@ init_reg_sets_1 (void)
}
else if (i == FRAME_POINTER_REGNUM)
;
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
else if (i == HARD_FRAME_POINTER_REGNUM)
else if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
&& i == HARD_FRAME_POINTER_REGNUM)
;
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
else if (i == ARG_POINTER_REGNUM && fixed_regs[i])
;

View File

@ -438,9 +438,8 @@ rename_chains (void)
if (frame_pointer_needed)
{
add_to_hard_reg_set (&unavailable, Pmode, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
add_to_hard_reg_set (&unavailable, Pmode, HARD_FRAME_POINTER_REGNUM);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
add_to_hard_reg_set (&unavailable, Pmode, HARD_FRAME_POINTER_REGNUM);
}
FOR_EACH_VEC_ELT (id_to_chain, i, this_head)

View File

@ -914,10 +914,9 @@ reload (rtx_insn *first, int global)
spill_hard_reg (from, 1);
}
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
if (frame_pointer_needed)
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER && frame_pointer_needed)
spill_hard_reg (HARD_FRAME_POINTER_REGNUM, 1);
#endif
finish_spills (global);
/* From now on, we may need to generate moves differently. We may also
@ -3281,13 +3280,13 @@ eliminate_regs_in_insn (rtx_insn *insn, int replace)
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
if (ep->from_rtx == SET_DEST (old_set) && ep->can_eliminate)
{
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
/* If this is setting the frame pointer register to the
hardware frame pointer register and this is an elimination
that will be done (tested above), this insn is really
adjusting the frame pointer downward to compensate for
the adjustment done before a nonlocal goto. */
if (ep->from == FRAME_POINTER_REGNUM
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
&& ep->from == FRAME_POINTER_REGNUM
&& ep->to == HARD_FRAME_POINTER_REGNUM)
{
rtx base = SET_SRC (old_set);
@ -3347,7 +3346,6 @@ eliminate_regs_in_insn (rtx_insn *insn, int replace)
goto done;
}
}
#endif
/* In this case this insn isn't serving a useful purpose. We
will delete it in reload_as_needed once we know that this

View File

@ -335,9 +335,8 @@ mark_referenced_resources (rtx x, struct resources *res,
if (frame_pointer_needed)
{
SET_HARD_REG_BIT (res->regs, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
SET_HARD_REG_BIT (res->regs, HARD_FRAME_POINTER_REGNUM);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
SET_HARD_REG_BIT (res->regs, HARD_FRAME_POINTER_REGNUM);
}
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
@ -1190,9 +1189,9 @@ init_resource_info (rtx_insn *epilogue_insn)
if (frame_pointer_needed)
{
SET_HARD_REG_BIT (end_of_function_needs.regs, FRAME_POINTER_REGNUM);
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM);
#endif
if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
SET_HARD_REG_BIT (end_of_function_needs.regs,
HARD_FRAME_POINTER_REGNUM);
}
if (!(frame_pointer_needed
&& EXIT_IGNORE_STACK