diff mbox

[lra] Fix rtl checking failure, part 2

Message ID 87zk3jc3bk.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com
State New
Headers show

Commit Message

Richard Sandiford Oct. 18, 2012, 1:33 p.m. UTC
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.

Comments

Vladimir Makarov Oct. 18, 2012, 8:26 p.m. UTC | #1
On 10/18/2012 09:33 AM, Richard Sandiford wrote:
> 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?
>
>
Yes.  Thanks, Richard.
diff mbox

Patch

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)