Check if mode is OK first

PR rtl-optimization/60024
	* sel-sched.c (init_regs_for_mode): Check if mode is OK first.

From-SVN: r207427
This commit is contained in:
H.J. Lu 2014-02-03 15:06:31 +00:00 committed by H.J. Lu
parent 8f36fd3017
commit f742cf901d
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2014-02-03 H.J. Lu <hongjiu.lu@intel.com>
PR rtl-optimization/60024
* sel-sched.c (init_regs_for_mode): Check if mode is OK first.
2014-02-03 Markus Trippelsdorf <markus@trippelsdorf.de>
* doc/invoke.texi: (fprofile-reorder-functions): Fix typo.

View File

@ -1116,9 +1116,16 @@ init_regs_for_mode (enum machine_mode mode)
for (cur_reg = 0; cur_reg < FIRST_PSEUDO_REGISTER; cur_reg++)
{
int nregs = hard_regno_nregs[cur_reg][mode];
int nregs;
int i;
/* See whether it accepts all modes that occur in
original insns. */
if (! HARD_REGNO_MODE_OK (cur_reg, mode))
continue;
nregs = hard_regno_nregs[cur_reg][mode];
for (i = nregs - 1; i >= 0; --i)
if (fixed_regs[cur_reg + i]
|| global_regs[cur_reg + i]
@ -1140,11 +1147,6 @@ init_regs_for_mode (enum machine_mode mode)
if (i >= 0)
continue;
/* See whether it accepts all modes that occur in
original insns. */
if (! HARD_REGNO_MODE_OK (cur_reg, mode))
continue;
if (HARD_REGNO_CALL_PART_CLOBBERED (cur_reg, mode))
SET_HARD_REG_BIT (sel_hrd.regs_for_call_clobbered[mode],
cur_reg);