diff options
author | Bernd Schmidt <bernds@cygnus.co.uk> | 1999-11-29 12:09:54 +0000 |
---|---|---|
committer | Bernd Schmidt <crux@gcc.gnu.org> | 1999-11-29 12:09:54 +0000 |
commit | 96b42f4c8c58667385e0090ef8f0765751ef7472 (patch) | |
tree | d938f5d703d708dead195d04a511bbaf206d15af /gcc/reload.c | |
parent | ca1a4af124196cef0751c8c8f504a45ecda9371f (diff) | |
download | gcc-96b42f4c8c58667385e0090ef8f0765751ef7472.zip gcc-96b42f4c8c58667385e0090ef8f0765751ef7472.tar.gz gcc-96b42f4c8c58667385e0090ef8f0765751ef7472.tar.bz2 |
Verify class is ok when allocating reload reg in push_reload
From-SVN: r30702
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 46f29a0..3ad2a7f 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1460,12 +1460,21 @@ 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)) { - rld[i].reg_rtx = gen_rtx_REG (inmode, regno); - break; + int offs; + int nregs = HARD_REGNO_NREGS (regno, inmode); + 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) + { + rld[i].reg_rtx = gen_rtx_REG (inmode, regno); + break; + } } } |