don't compare ARG_FRAME_POINTER_REGNUM and FRAME_POINTER_REGNUM with the preprocessor

gcc/ChangeLog:

2015-05-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* combine.c, df-problems.c, df-scan.c, emit-rtl.c, reginfo.c,
	reload.c, rtlanal.c: Remove comparison of ARG_FRAME_POINTER_REGNUM
	and FRAME_POINTER_REGNUM with the preprocessor.

From-SVN: r223516
This commit is contained in:
Trevor Saunders 2015-05-22 01:03:59 +00:00 committed by Trevor Saunders
parent dfed696157
commit 3f393fc679
8 changed files with 32 additions and 37 deletions

View File

@ -1,3 +1,9 @@
2015-05-20 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* combine.c, df-problems.c, df-scan.c, emit-rtl.c, reginfo.c,
reload.c, rtlanal.c: Remove comparison of ARG_FRAME_POINTER_REGNUM
and FRAME_POINTER_REGNUM with the preprocessor.
2015-05-20 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h: Add default for STACK_PUSH_CODE.

View File

@ -1028,10 +1028,8 @@ can_combine_def_p (df_ref def)
|| (regno == HARD_FRAME_POINTER_REGNUM
&& (!reload_completed || frame_pointer_needed))
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|| (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif
)
|| (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& regno == ARG_POINTER_REGNUM && fixed_regs[regno]))
return false;
return true;
@ -2247,10 +2245,9 @@ combinable_i3pat (rtx_insn *i3, rtx *loc, rtx i2dest, rtx i1dest, rtx i0dest,
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
&& REGNO (subdest) != HARD_FRAME_POINTER_REGNUM
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& (REGNO (subdest) != ARG_POINTER_REGNUM
|| ! fixed_regs [REGNO (subdest)])
#endif
&& (FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
|| (REGNO (subdest) != ARG_POINTER_REGNUM
|| ! fixed_regs [REGNO (subdest)]))
&& REGNO (subdest) != STACK_POINTER_REGNUM)
{
if (*pi3dest_killed)
@ -13340,9 +13337,8 @@ mark_used_regs_combine (rtx x)
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
|| regno == HARD_FRAME_POINTER_REGNUM
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|| (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif
|| (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& regno == ARG_POINTER_REGNUM && fixed_regs[regno])
|| regno == FRAME_POINTER_REGNUM)
return;

View File

@ -933,12 +933,11 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
reference of the frame pointer. */
bitmap_set_bit (&df->hardware_regs_used, FRAME_POINTER_REGNUM);
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */
if (fixed_regs[ARG_POINTER_REGNUM])
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (&df->hardware_regs_used, ARG_POINTER_REGNUM);
#endif
/* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */

View File

@ -3446,12 +3446,11 @@ df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses)
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
reloading via the argument pointer. */
if (fixed_regs[ARG_POINTER_REGNUM])
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (regular_block_artificial_uses, ARG_POINTER_REGNUM);
#endif
/* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */
@ -3498,10 +3497,9 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses)
bitmap_set_bit (eh_block_artificial_uses,
HARD_FRAME_POINTER_REGNUM);
}
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
if (fixed_regs[ARG_POINTER_REGNUM])
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (eh_block_artificial_uses, ARG_POINTER_REGNUM);
#endif
}
}
@ -3579,12 +3577,11 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
/* These registers are live everywhere. */
if (!reload_completed)
{
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */
if (fixed_regs[ARG_POINTER_REGNUM])
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (entry_block_defs, ARG_POINTER_REGNUM);
#endif
/* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */
@ -3781,16 +3778,15 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
EXIT_BLOCK_PTR_FOR_FN (cfun), NULL, DF_REF_REG_USE, 0);
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* It is deliberate that this is not put in the exit block uses but
I do not know why. */
if (reload_completed
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& reload_completed
&& !bitmap_bit_p (exit_block_uses, ARG_POINTER_REGNUM)
&& bb_has_eh_pred (EXIT_BLOCK_PTR_FOR_FN (cfun))
&& fixed_regs[ARG_POINTER_REGNUM])
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
EXIT_BLOCK_PTR_FOR_FN (cfun), NULL, DF_REF_REG_USE, 0);
#endif
df_canonize_collection_rec (collection_rec);
}

View File

@ -739,8 +739,9 @@ gen_rtx_REG (machine_mode mode, unsigned int regno)
&& regno == HARD_FRAME_POINTER_REGNUM
&& (!reload_completed || frame_pointer_needed))
return hard_frame_pointer_rtx;
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && !HARD_FRAME_POINTER_IS_ARG_POINTER
if (regno == ARG_POINTER_REGNUM)
#if !HARD_FRAME_POINTER_IS_ARG_POINTER
if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& regno == ARG_POINTER_REGNUM)
return arg_pointer_rtx;
#endif
#ifdef RETURN_ADDRESS_POINTER_REGNUM

View File

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

View File

@ -5184,9 +5184,8 @@ find_reloads_address (machine_mode mode, rtx *memrefloc, rtx ad,
#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
|| operand == hard_frame_pointer_rtx
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|| operand == arg_pointer_rtx
#endif
|| (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& operand == arg_pointer_rtx)
|| operand == stack_pointer_rtx)
&& ! maybe_memory_address_addr_space_p
(mode, ad, as, &XEXP (XEXP (ad, 0), 1 - op_index)))

View File

@ -1445,9 +1445,8 @@ refers_to_regno_p (unsigned int regno, unsigned int endregno, const_rtx x,
clobber a virtual register. In fact, we could be more precise,
but it isn't worth it. */
if ((x_regno == STACK_POINTER_REGNUM
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|| x_regno == ARG_POINTER_REGNUM
#endif
|| (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& x_regno == ARG_POINTER_REGNUM)
|| x_regno == FRAME_POINTER_REGNUM)
&& regno >= FIRST_VIRTUAL_REGISTER && regno <= LAST_VIRTUAL_REGISTER)
return true;