aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@cygnus.co.uk>1999-11-29 12:09:54 +0000
committerBernd Schmidt <crux@gcc.gnu.org>1999-11-29 12:09:54 +0000
commit96b42f4c8c58667385e0090ef8f0765751ef7472 (patch)
treed938f5d703d708dead195d04a511bbaf206d15af
parentca1a4af124196cef0751c8c8f504a45ecda9371f (diff)
downloadgcc-96b42f4c8c58667385e0090ef8f0765751ef7472.zip
gcc-96b42f4c8c58667385e0090ef8f0765751ef7472.tar.gz
gcc-96b42f4c8c58667385e0090ef8f0765751ef7472.tar.bz2
Verify class is ok when allocating reload reg in push_reload
From-SVN: r30702
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/reload.c19
2 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 03127a8..a1a0e39 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
1999-11-29 Bernd Schmidt <bernds@cygnus.co.uk>
+ * 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.
+
* haifa-sched.c (reg_last_uses, reg_last_sets, reg_last_clobbers,
pending_read_insns, pending_write_insns, pending_read_mems,
pending_write_mems, pending_list_length, last_pending_memory_flush,
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;
+ }
}
}