Commit 223de6da by Alan Modra Committed by Alan Modra

[RS6000] PR69645, -ffixed-reg ignored

Treat -ffixed-reg as we do for global asm regs.

	PR target/69645
	* config/rs6000/rs6000.c (fixed_reg_p): New function.
	(fixed_regs_p): Rename from global_regs_p.  Call fixed_reg_p.
	Update all uses.

From-SVN: r235670
parent fd1c95f7
2016-04-30 Alan Modra <amodra@gmail.com> 2016-04-30 Alan Modra <amodra@gmail.com>
PR target/69645
* config/rs6000/rs6000.c (fixed_reg_p): New function.
(fixed_regs_p): Rename from global_regs_p. Call fixed_reg_p.
Update all uses.
2016-04-30 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (rs6000_conditional_register_usage): * config/rs6000/rs6000.c (rs6000_conditional_register_usage):
Remove redundant PIC_OFFSET_TABLE_REGNUM test. Replace with Remove redundant PIC_OFFSET_TABLE_REGNUM test. Replace with
flag_pic test for Darwin. flag_pic test for Darwin.
......
...@@ -23230,17 +23230,34 @@ is_altivec_return_reg (rtx reg, void *xyes) ...@@ -23230,17 +23230,34 @@ is_altivec_return_reg (rtx reg, void *xyes)
} }
/* Look for user-defined global regs in the range FIRST to LAST-1. /* Return whether REG is a global user reg or has been specifed by
We should not restore these, and so cannot use lmw or out-of-line -ffixed-REG. */
restore functions if there are any. We also can't save them
(well, emit frame notes for them), because frame unwinding during
exception handling will restore saved registers. */
static bool static bool
global_regs_p (unsigned first, unsigned last) fixed_reg_p (int reg)
{
/* Ignore fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] when the
backend sets it, overriding anything the user might have given. */
if (reg == RS6000_PIC_OFFSET_TABLE_REGNUM
&& ((DEFAULT_ABI == ABI_V4 && flag_pic)
|| (DEFAULT_ABI == ABI_DARWIN && flag_pic)
|| (TARGET_TOC && TARGET_MINIMAL_TOC)))
return false;
return fixed_regs[reg];
}
/* Look for user-defined global regs or -ffixed-<reg> in the range
FIRST to LAST-1. We should not restore these, and so cannot use
lmw or out-of-line restore functions if there are any. We also
can't save them (well, emit frame notes for them), because frame
unwinding during exception handling will restore saved registers. */
static bool
fixed_regs_p (unsigned first, unsigned last)
{ {
while (first < last) while (first < last)
if (global_regs[first++]) if (fixed_reg_p (first++))
return true; return true;
return false; return false;
} }
...@@ -23271,7 +23288,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, ...@@ -23271,7 +23288,7 @@ rs6000_savres_strategy (rs6000_stack_t *info,
&& !TARGET_POWERPC64 && !TARGET_POWERPC64
&& !(TARGET_SPE_ABI && info->spe_64bit_regs_used) && !(TARGET_SPE_ABI && info->spe_64bit_regs_used)
&& info->first_gp_reg_save < 31 && info->first_gp_reg_save < 31
&& !global_regs_p (info->first_gp_reg_save, 32)) && !fixed_regs_p (info->first_gp_reg_save, 32))
strategy |= SAVRES_MULTIPLE; strategy |= SAVRES_MULTIPLE;
if (crtl->calls_eh_return if (crtl->calls_eh_return
...@@ -23284,16 +23301,16 @@ rs6000_savres_strategy (rs6000_stack_t *info, ...@@ -23284,16 +23301,16 @@ rs6000_savres_strategy (rs6000_stack_t *info,
/* The out-of-line FP routines use double-precision stores; /* The out-of-line FP routines use double-precision stores;
we can't use those routines if we don't have such stores. */ we can't use those routines if we don't have such stores. */
|| (TARGET_HARD_FLOAT && !TARGET_DOUBLE_FLOAT) || (TARGET_HARD_FLOAT && !TARGET_DOUBLE_FLOAT)
|| global_regs_p (info->first_fp_reg_save, 64)) || fixed_regs_p (info->first_fp_reg_save, 64))
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
if (info->first_gp_reg_save == 32 if (info->first_gp_reg_save == 32
|| (!(strategy & SAVRES_MULTIPLE) || (!(strategy & SAVRES_MULTIPLE)
&& global_regs_p (info->first_gp_reg_save, 32))) && fixed_regs_p (info->first_gp_reg_save, 32)))
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
if (info->first_altivec_reg_save == LAST_ALTIVEC_REGNO + 1 if (info->first_altivec_reg_save == LAST_ALTIVEC_REGNO + 1
|| global_regs_p (info->first_altivec_reg_save, LAST_ALTIVEC_REGNO + 1)) || fixed_regs_p (info->first_altivec_reg_save, LAST_ALTIVEC_REGNO + 1))
strategy |= SAVE_INLINE_VRS | REST_INLINE_VRS; strategy |= SAVE_INLINE_VRS | REST_INLINE_VRS;
/* Define cutoff for using out-of-line functions to save registers. */ /* Define cutoff for using out-of-line functions to save registers. */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment