s390.c (s390_call_save_register_used): Switch back to HARD_REGNO_NREGS.
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Thu, 15 Apr 2010 16:30:32 +0000 (16:30 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 15 Apr 2010 16:30:32 +0000 (16:30 +0000)
2010-04-15  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

* config/s390/s390.c (s390_call_save_register_used): Switch back
to HARD_REGNO_NREGS.

From-SVN: r158384

gcc/ChangeLog
gcc/config/s390/s390.c

index 3610918..ba332d1 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-15  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * config/s390/s390.c (s390_call_save_register_used): Switch back
+       to HARD_REGNO_NREGS.
+
 2010-04-15  Richard Guenther  <rguenther@suse.de>
 
        * alias.c (alias_set_subset_of): Handle alias-set zero
index d0fbe5a..c3820e5 100644 (file)
@@ -9449,17 +9449,9 @@ s390_call_saved_register_used (tree call_expr)
 
        if (REG_P (parm_rtx))
         {
-          int n_regs;
-
-          /* Only integer registers (r6) are call saved and used for
-             parameter passing.  */
-          if (REGNO_REG_CLASS (REGNO (parm_rtx)) == FP_REGS)
-            continue;
-
-          n_regs = ((GET_MODE_SIZE (GET_MODE (parm_rtx)) + UNITS_PER_LONG - 1)
-                    / UNITS_PER_LONG);
-
-          for (reg = 0; reg < n_regs; reg++)
+          for (reg = 0;
+               reg < HARD_REGNO_NREGS (REGNO (parm_rtx), GET_MODE (parm_rtx));
+               reg++)
             if (!call_used_regs[reg + REGNO (parm_rtx)])
               return true;
         }
@@ -9467,22 +9459,16 @@ s390_call_saved_register_used (tree call_expr)
        if (GET_CODE (parm_rtx) == PARALLEL)
         {
           int i;
+
           for (i = 0; i < XVECLEN (parm_rtx, 0); i++)
             {
               rtx r = XEXP (XVECEXP (parm_rtx, 0, i), 0);
-              int n_regs;
 
               gcc_assert (REG_P (r));
 
-              /* Only integer registers (r6) are call saved and used
-                 for parameter passing.  */
-              if (REGNO_REG_CLASS (REGNO (r)) == FP_REGS)
-                continue;
-
-              n_regs = ((GET_MODE_SIZE (GET_MODE (r)) + UNITS_PER_LONG - 1)
-                        / UNITS_PER_LONG);
-
-              for (reg = 0; reg < n_regs; reg++)
+              for (reg = 0;
+                   reg < HARD_REGNO_NREGS (REGNO (r), GET_MODE (r));
+                   reg++)
                 if (!call_used_regs[reg + REGNO (r)])
                   return true;
             }