From: Bernd Schmidt Date: Thu, 30 Nov 2000 12:20:44 +0000 (+0000) Subject: Backport two changes to the 2.95 branch X-Git-Tag: prereleases/gcc-2.95.3-test1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a21af14992da809e307b45132bdff6d8969bdf4;p=thirdparty%2Fgcc.git Backport two changes to the 2.95 branch From-SVN: r37885 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 607a0a6e3e32..52ae16e8b57c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2000-11-30 Bernd Schmidt + Thu Jul 6 18:30:36 2000 Richard Kenner + * reload.c (push_reload): When seeing if can reuse a register, + check extra registers against widest of INMODE and OUTMODE. + + 1999-11-29 Bernd Schmidt + * reload.c (push_reload): When looking for a register to put into + reg_rtx, make sure all hard regs in a multi-reg register are in the + right class and nonfixed. + 1999-11-29 Joern Rennecke * reload1.c (reloads_conflict): Reverse test comparing operand numbers when testing for conflict between output/outaddr reloads. diff --git a/gcc/reload.c b/gcc/reload.c index 7c2c14e65c91..689acaa2ec3c 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1535,12 +1535,23 @@ push_reload (in, out, inloc, outloc, class, && GET_MODE_SIZE (inmode) <= GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) && HARD_REGNO_MODE_OK (regno, inmode) && GET_MODE_SIZE (outmode) <= GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) - && HARD_REGNO_MODE_OK (regno, outmode) - && TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno) - && !fixed_regs[regno]) + && HARD_REGNO_MODE_OK (regno, outmode)) { - reload_reg_rtx[i] = gen_rtx_REG (inmode, regno); - break; + unsigned int offs; + unsigned int nregs = MAX (HARD_REGNO_NREGS (regno, inmode), + HARD_REGNO_NREGS (regno, outmode)); + + for (offs = 0; offs < nregs; offs++) + if (fixed_regs[regno + offs] + || ! TEST_HARD_REG_BIT (reg_class_contents[(int) class], + regno + offs)) + break; + + if (offs == nregs) + { + reload_reg_rtx[i] = gen_rtx_REG (inmode, regno); + break; + } } }