aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2007-12-10 08:46:12 +0100
committerUros Bizjak <uros@gcc.gnu.org>2007-12-10 08:46:12 +0100
commitec382b8ca30c83a52b2c1a0d413e334d657cdb23 (patch)
tree2830f7184b743b518465dec9680e641f55fd0b8a
parent466e4b7a17c37f586dc9000bd040f37463e64f54 (diff)
downloadgcc-ec382b8ca30c83a52b2c1a0d413e334d657cdb23.zip
gcc-ec382b8ca30c83a52b2c1a0d413e334d657cdb23.tar.gz
gcc-ec382b8ca30c83a52b2c1a0d413e334d657cdb23.tar.bz2
i386.c (ix86_function_regparm): Ditto.
* 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
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/config/i386/i386.c26
-rw-r--r--gcc/config/i386/i386.md4
3 files changed, 30 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 157907f..ded5d42 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
@@ -160,8 +172,7 @@
(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
@@ -238,7 +249,7 @@
* 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".
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 095ba17..ef5b7a9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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);
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 9b03b95..c53ea7f 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -18714,7 +18714,7 @@
/* 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],
@@ -19200,7 +19200,7 @@
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];