From 96b42f4c8c58667385e0090ef8f0765751ef7472 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Mon, 29 Nov 1999 12:09:54 +0000 Subject: [PATCH] Verify class is ok when allocating reload reg in push_reload From-SVN: r30702 --- gcc/ChangeLog | 4 ++++ gcc/reload.c | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03127a89e5b..a1a0e3980c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 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. + * 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 46f29a069c7..3ad2a7f0b45 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; + } } } -- 2.30.2