Index: gcc/haifa-sched.c
===================================================================
--- gcc/haifa-sched.c   (revision 167598)
+++ gcc/haifa-sched.c   (working copy)
@@ -672,11 +672,11 @@
   if (REG_P (x))
     {
       regno = REGNO (x);
-      if (regno >= FIRST_PSEUDO_REGISTER)
+      if (HARD_REGISTER_NUM_P (regno))
+       bitmap_set_range (region_ref_regs, regno,
+                         hard_regno_nregs[regno][GET_MODE (x)]);
+      else
        bitmap_set_bit (region_ref_regs, REGNO (x));
-      else
-       for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--)
-         bitmap_set_bit (region_ref_regs, regno + i);
       return;
     }
   fmt = GET_RTX_FORMAT (code);
Index: gcc/caller-save.c
===================================================================
--- gcc/caller-save.c   (revision 167598)
+++ gcc/caller-save.c   (working copy)
@@ -1317,7 +1317,7 @@
 static int
 add_used_regs_1 (rtx *loc, void *data)
 {
-  int regno, i;
+  unsigned int regno;
   regset live;
   rtx x;
 
@@ -1326,11 +1326,10 @@
   if (REG_P (x))
     {
       regno = REGNO (x);
-      if (!HARD_REGISTER_NUM_P (regno))
+      if (HARD_REGISTER_NUM_P (regno))
+       bitmap_set_range (live, regno, hard_regno_nregs[regno][GET_MODE (x)]);
+      else
        regno = reg_renumber[regno];
-      if (regno >= 0)
-       for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--)
-         SET_REGNO_REG_SET (live, regno + i);
     }
   return 0;
 }
Index: gcc/dse.c
===================================================================
--- gcc/dse.c   (revision 167598)
+++ gcc/dse.c   (working copy)
@@ -1781,12 +1781,11 @@
   bitmap regs_set = (bitmap) data;
 
   if (REG_P (x)
-      && REGNO (x) < FIRST_PSEUDO_REGISTER)
+      && HARD_REGISTER_P (x))
     {
-      int regno = REGNO (x);
-      int n = hard_regno_nregs[regno][GET_MODE (x)];
-      while (--n >= 0)
-       bitmap_set_bit (regs_set, regno + n);
+      unsigned int regno = REGNO (x);
+      bitmap_set_range (regs_set, regno,
+                       hard_regno_nregs[regno][GET_MODE (x)]);
     }
 }
 
Index: gcc/cfgcleanup.c
===================================================================
--- gcc/cfgcleanup.c    (revision 167598)
+++ gcc/cfgcleanup.c    (working copy)
@@ -204,13 +204,11 @@
        {
          dest = XEXP (exp, 0);
          regno = REGNO (dest);
-         CLEAR_REGNO_REG_SET (nonequal, regno);
-         if (regno < FIRST_PSEUDO_REGISTER)
-           {
-             int n = hard_regno_nregs[regno][GET_MODE (dest)];
-             while (--n > 0)
-               CLEAR_REGNO_REG_SET (nonequal, regno + n);
-           }
+         if (HARD_REGISTER_NUM_P (regno))
+           bitmap_clear_range (nonequal, regno,
+                               hard_regno_nregs[regno][GET_MODE (dest)]);
+         else
+           bitmap_clear_bit (nonequal, regno);
        }
       return false;
 
@@ -223,13 +221,11 @@
       if (!REG_P (dest))
        return true;
       regno = REGNO (dest);
-      SET_REGNO_REG_SET (nonequal, regno);
-      if (regno < FIRST_PSEUDO_REGISTER)
-       {
-         int n = hard_regno_nregs[regno][GET_MODE (dest)];
-         while (--n > 0)
-           SET_REGNO_REG_SET (nonequal, regno + n);
-       }
+      if (HARD_REGISTER_NUM_P (regno))
+       bitmap_set_range (nonequal, regno,
+                         hard_regno_nregs[regno][GET_MODE (dest)]);
+      else
+       bitmap_set_bit (nonequal, regno);
       return false;
 
     default:
Index: gcc/df-problems.c
===================================================================
--- gcc/df-problems.c   (revision 167598)
+++ gcc/df-problems.c   (working copy)
@@ -3752,12 +3752,9 @@
          {
            rtx reg = XEXP (link, 0);
            int regno = REGNO (reg);
-           if (regno < FIRST_PSEUDO_REGISTER)
-             {
-               int n = hard_regno_nregs[regno][GET_MODE (reg)];
-               while (--n >= 0)
-                 bitmap_clear_bit (live, regno + n);
-             }
+           if (HARD_REGISTER_NUM_P (regno))
+             bitmap_clear_range (live, regno,
+                                 hard_regno_nregs[regno][GET_MODE (reg)]);
            else
              bitmap_clear_bit (live, regno);
          }
Index: gcc/sched-rgn.c
===================================================================
--- gcc/sched-rgn.c     (revision 167598)
+++ gcc/sched-rgn.c     (working copy)
@@ -1762,30 +1762,19 @@
 
   regno = REGNO (reg);
 
-  if (regno >= FIRST_PSEUDO_REGISTER || !global_regs[regno])
+  if (! HARD_REGISTER_NUM_P (regno)
+      || !global_regs[regno])
     {
-      if (regno < FIRST_PSEUDO_REGISTER)
+      for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++)
        {
-         int j = hard_regno_nregs[regno][GET_MODE (reg)];
-         while (--j >= 0)
-           {
-             for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++)
-               {
-                 basic_block b = candidate_table[src].update_bbs.first_member[i];
+         basic_block b = candidate_table[src].update_bbs.first_member[i];
 
-                 SET_REGNO_REG_SET (df_get_live_in (b), regno + j);
-               }
-           }
+         if (HARD_REGISTER_NUM_P (regno))
+           bitmap_set_range (df_get_live_in (b), regno,
+                             hard_regno_nregs[regno][GET_MODE (reg)]);
+         else
+           bitmap_set_bit (df_get_live_in (b), regno);
        }
-      else
-       {
-         for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++)
-           {
-             basic_block b = candidate_table[src].update_bbs.first_member[i];
-
-             SET_REGNO_REG_SET (df_get_live_in (b), regno);
-           }
-       }
     }
 }
 
