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

login
register
mail settings
Submitter Vladimir Makarov
Date Aug. 4, 2011, 10 p.m.
Message ID <4E3B166E.9070801@redhat.com>
Download mbox | patch
Permalink /patch/108575/
State New
Headers show

Comments

Vladimir Makarov - Aug. 4, 2011, 10 p.m.
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.

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));
     }