Patchwork [lra] Fix rtl checking failure, part 2

login
register
mail settings
Submitter Richard Sandiford
Date Oct. 18, 2012, 1:33 p.m.
Message ID <87zk3jc3bk.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com>
Download mbox | patch
Permalink /patch/192320/
State New
Headers show

Comments

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

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)