Commit 4817c43b by Richard Sandiford Committed by Richard Sandiford

mips.c (mips_save_reg_p): Don't short-circuit rest of function when handling GLOBAL_POINTER_REGNUM.

gcc/
	* config/mips/mips.c (mips_save_reg_p): Don't short-circuit rest
	of function when handling GLOBAL_POINTER_REGNUM.

From-SVN: r139169
parent 74745ec5
2008-08-17 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.c (mips_save_reg_p): Don't short-circuit rest
of function when handling GLOBAL_POINTER_REGNUM.
2008-08-16 Eric Botcazou <ebotcazou@adacore.com> 2008-08-16 Eric Botcazou <ebotcazou@adacore.com>
PR ada/20548 PR ada/20548
......
...@@ -8322,10 +8322,12 @@ mips_global_pointer (void) ...@@ -8322,10 +8322,12 @@ mips_global_pointer (void)
static bool static bool
mips_save_reg_p (unsigned int regno) mips_save_reg_p (unsigned int regno)
{ {
/* We only need to save $gp if TARGET_CALL_SAVED_GP and only then /* We need to save $gp if TARGET_CALL_SAVED_GP and if we have not
if we have not chosen a call-clobbered substitute. */ chosen a call-clobbered substitute. */
if (regno == GLOBAL_POINTER_REGNUM) if (TARGET_CALL_SAVED_GP
return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno; && regno == GLOBAL_POINTER_REGNUM
&& cfun->machine->global_pointer == regno)
return true;
/* Check call-saved registers. */ /* Check call-saved registers. */
if ((crtl->saves_all_registers || df_regs_ever_live_p (regno)) if ((crtl->saves_all_registers || df_regs_ever_live_p (regno))
......
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