diff mbox

[lra] patch to fix listdc++ build failure on ppc64

Message ID 4E3B166E.9070801@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov Aug. 4, 2011, 10 p.m. UTC
The following patch fixes a bug introduced by a recent LRA patch.

The patch was successfully bootstrapped on x86-64 and ppc64.

2011-08-04  Vladimir Makarov <vmakarov@redhat.com>

         * lra-constraints.c (uses_hard_regs_p): Use hard register
         elimination.
diff mbox

Patch

Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 176950)
+++ lra-constraints.c	(working copy)
@@ -1249,7 +1303,7 @@  get_final_hard_regno (int hard_regno, in
 static bool
 uses_hard_regs_p (rtx *loc, HARD_REG_SET set)
 {
-  int i, j, x_hard_regno;
+  int i, j, x_hard_regno, offset;
   enum machine_mode mode;
   rtx x;
   const char *fmt;
@@ -1271,9 +1325,10 @@  uses_hard_regs_p (rtx *loc, HARD_REG_SET
   
   if (REG_P (x))
     {
-      x_hard_regno = REGNO (x);
-      if (x_hard_regno >= FIRST_PSEUDO_REGISTER)
-	x_hard_regno = reg_renumber[x_hard_regno];
+      lra_get_hard_regno_and_offset (x, &x_hard_regno, &offset);
+      /* The real hard regno of the operand after the allocation.  It
+	 can be negative only for registers.  */
+      x_hard_regno = get_final_hard_regno (x_hard_regno, offset);
       return (x_hard_regno >= 0
 	      && lra_hard_reg_set_intersection_p (x_hard_regno, mode, set));
     }