From 894113c35c8cc3caa9b15860eb9ad06130776091 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sat, 20 Aug 2011 19:00:40 +0000 Subject: [PATCH] mips.c (mips_class_max_nregs): Check that the mode is OK for ST_REGS and FP_REGS before taking those classes... gcc/ * config/mips/mips.c (mips_class_max_nregs): Check that the mode is OK for ST_REGS and FP_REGS before taking those classes into account. From-SVN: r177931 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee94a7956b2..4ca6298dc1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-08-20 Richard Sandiford + + * config/mips/mips.c (mips_class_max_nregs): Check that the mode is + OK for ST_REGS and FP_REGS before taking those classes into account. + 2011-08-20 Richard Sandiford * config/mips/mips.c (mips_reorg_process_insns): Check for jumps diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 5a410eb0464..53542aabbb0 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -10630,12 +10630,14 @@ mips_class_max_nregs (enum reg_class rclass, enum machine_mode mode) COPY_HARD_REG_SET (left, reg_class_contents[(int) rclass]); if (hard_reg_set_intersect_p (left, reg_class_contents[(int) ST_REGS])) { - size = MIN (size, 4); + if (HARD_REGNO_MODE_OK (ST_REG_FIRST, mode)) + size = MIN (size, 4); AND_COMPL_HARD_REG_SET (left, reg_class_contents[(int) ST_REGS]); } if (hard_reg_set_intersect_p (left, reg_class_contents[(int) FP_REGS])) { - size = MIN (size, UNITS_PER_FPREG); + if (HARD_REGNO_MODE_OK (FP_REG_FIRST, mode)) + size = MIN (size, UNITS_PER_FPREG); AND_COMPL_HARD_REG_SET (left, reg_class_contents[(int) FP_REGS]); } if (!hard_reg_set_empty_p (left)) -- 2.30.2