i386.c (ix86_function_regparm): Ditto.
authorUros Bizjak <uros@gcc.gnu.org>
Mon, 10 Dec 2007 07:46:12 +0000 (08:46 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 10 Dec 2007 07:46:12 +0000 (08:46 +0100)
* config/i386/i386.c (ix86_function_regparm): Ditto. Use REGPARM_MAX
to check that no regparm hard register is taken by a fixed register
variable. Check up to and including DI_REG when adjusting regparm
value due to fixed regs usage.
(rep_prefix_usable): Check fixed_regs array, not global_regs array for
available hard registers.
(ix86_expand_strlen): Ditto.
* config/i386/i386.md (strmov): Ditto.
(cmpstrnsi): Ditto.

From-SVN: r130737

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md

index 157907f..ded5d42 100644 (file)
@@ -1,3 +1,15 @@
+2007-12-10 Uros Bizjak <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_function_regparm): Ditto. Use REGPARM_MAX
+       to check that no regparm hard register is taken by a fixed register
+       variable. Check up to and including DI_REG when adjusting regparm
+       value due to fixed regs usage.
+       (rep_prefix_usable): Check fixed_regs array, not global_regs array for
+       available hard registers.
+       (ix86_expand_strlen): Ditto.
+       * config/i386/i386.md (strmov): Ditto.
+       (cmpstrnsi): Ditto.
+
 2007-12-10  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * genopinit.c: Include tm_p.h in generated file.
        (execute_fold_all_builtins): Call it for BUILT_IN_VA_START,
        BUILT_IN_VA_COPY and BUILT_IN_VA_END.
 
-       * target.h (struct ggc_target): Add expand_builtin_va_start
-       hook.
+       * target.h (struct ggc_target): Add expand_builtin_va_start hook.
        * target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define.
        (TARGET_INITIALIZER): Add it.
        * builtins.c (expand_builtin_va_start): Use
        * mips/mips.c (mips_va_start): Made static.
        (TARGET_EXPAND_BUILTIN_VA_START): Define.
 
-2007-12-05  Uros Bizjak  <ubizjak@gmail.com>
+2007-12-06  Uros Bizjak  <ubizjak@gmail.com>
 
        * tree-ssa-loop.c (gate_tree_parallelize_loops): Return true when
        "flag_tree_parallelize_loops > 1".
index 095ba17..ef5b7a9 100644 (file)
@@ -3203,9 +3203,9 @@ ix86_function_regparm (const_tree type, const_tree decl)
          struct function *f;
 
          /* Make sure no regparm register is taken by a
-            fixed register or global register variable.  */
-         for (local_regparm = 0; local_regparm < 3; local_regparm++)
-           if (global_regs[local_regparm] || fixed_regs[local_regparm])
+            fixed register variable.  */
+         for (local_regparm = 0; local_regparm < REGPARM_MAX; local_regparm++)
+           if (fixed_regs[local_regparm])
              break;
 
          /* We can't use regparm(3) for nested functions as these use
@@ -3227,13 +3227,14 @@ ix86_function_regparm (const_tree type, const_tree decl)
                                        TYPE_ATTRIBUTES (TREE_TYPE (decl)))))
            local_regparm = 2;
 
-         /* Each global register variable or fixed register usage
-            increases register pressure, so less registers should be
-            used for argument passing.  This functionality can be
-            overriden by explicit regparm value.  */
-         for (regno = 0; regno < 6; regno++)
-           if (global_regs[regno] || fixed_regs[regno])
+         /* Each fixed register usage increases register pressure,
+            so less registers should be used for argument passing.
+            This functionality can be overriden by an explicit
+            regparm value.  */
+         for (regno = 0; regno <= DI_REG; regno++)
+           if (fixed_regs[regno])
              globals++;
+
          local_regparm
            = globals < local_regparm ? local_regparm - globals : 0;
 
@@ -15108,8 +15109,9 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset,
      additionally, memset wants eax and memcpy wants esi.  Don't
      consider such algorithms if the user has appropriated those
      registers for their own purposes. */
-  bool rep_prefix_usable = !(global_regs[CX_REG] || global_regs[DI_REG]
-                             || (memset ? global_regs[AX_REG] : global_regs[SI_REG]));
+  bool rep_prefix_usable = !(fixed_regs[CX_REG] || fixed_regs[DI_REG]
+                             || (memset
+                                ? fixed_regs[AX_REG] : fixed_regs[SI_REG]));
 
 #define ALG_USABLE_P(alg) (rep_prefix_usable                   \
                           || (alg != rep_prefix_1_byte         \
@@ -16084,7 +16086,7 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align)
       rtx unspec;
 
       /* Can't use this if the user has appropriated eax, ecx, or edi.  */
-      if (global_regs[AX_REG] || global_regs[CX_REG] || global_regs[DI_REG])
+      if (fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])
         return false;
 
       scratch2 = gen_reg_rtx (Pmode);
index 9b03b95..c53ea7f 100644 (file)
 
   /* Can't use this if the user has appropriated esi or edi.  */
   if ((TARGET_SINGLE_STRINGOP || optimize_size)
-      && !(global_regs[SI_REG] || global_regs[DI_REG]))
+      && !(fixed_regs[SI_REG] || fixed_regs[DI_REG]))
     {
       emit_insn (gen_strmov_singleop (operands[0], operands[1],
                                      operands[2], operands[3],
   rtx addr1, addr2, out, outlow, count, countreg, align;
 
   /* Can't use this if the user has appropriated esi or edi.  */
-  if (global_regs[SI_REG] || global_regs[DI_REG])
+  if (fixed_regs[SI_REG] || fixed_regs[DI_REG])
     FAIL;
 
   out = operands[0];