This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lra] Fix rtl checking failure, part 2


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]