From patchwork Thu Oct 18 13:33:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [lra] Fix rtl checking failure, part 2 Date: Thu, 18 Oct 2012 03:33:35 -0000 From: Richard Sandiford X-Patchwork-Id: 192320 Message-Id: <87zk3jc3bk.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> To: gcc-patches@gcc.gnu.org Cc: vmakarov@redhat.com Another simple patch for an rtl checking problem. We were trying to apply REGNO to something that was no longer a register (because of equiv substitution). Tested on x86_64-linux-gnu. OK for lra branch? Richard gcc/ * lra-constraints.c (check_and_process_move): Only apply REGNO to registers. Index: gcc/lra-constraints.c =================================================================== --- gcc/lra-constraints.c 2012-10-18 09:49:57.000000000 +0100 +++ gcc/lra-constraints.c 2012-10-18 11:59:22.153426568 +0100 @@ -1145,14 +1145,18 @@ check_and_process_move (bool *change_p, /* Set up hard register for a reload pseudo for hook secondary_reload because some targets just ignore unassigned pseudos in the hook. */ - dregno = REGNO (dreg); - if (dclass != NO_REGS && lra_get_regno_hard_regno (dregno) < 0) - reg_renumber[dregno] = ira_class_hard_regs[dclass][0]; + if (dclass != NO_REGS && lra_get_regno_hard_regno (REGNO (dreg)) < 0) + { + dregno = REGNO (dreg); + reg_renumber[dregno] = ira_class_hard_regs[dclass][0]; + } else dregno = -1; - sregno = REGNO (sreg); - if (sclass != NO_REGS && lra_get_regno_hard_regno (sregno) < 0) - reg_renumber[sregno] = ira_class_hard_regs[sclass][0]; + if (sclass != NO_REGS && lra_get_regno_hard_regno (REGNO (sreg)) < 0) + { + sregno = REGNO (sreg); + reg_renumber[sregno] = ira_class_hard_regs[sclass][0]; + } else sregno = -1; if (sclass != NO_REGS)