aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-10-07 03:22:49 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-10-07 03:22:49 -0700
commitde3beb7c7d5dc4ee86e0b9bb14199b47d2e988bf (patch)
tree4f473610f9cfb03c7a89d174e7077ffe161fe12a /gcc/config
parent01f4137fea19db8118b225ce86b39aa6831b7ba2 (diff)
downloadgcc-de3beb7c7d5dc4ee86e0b9bb14199b47d2e988bf.zip
gcc-de3beb7c7d5dc4ee86e0b9bb14199b47d2e988bf.tar.gz
gcc-de3beb7c7d5dc4ee86e0b9bb14199b47d2e988bf.tar.bz2
i960.c (i960_setup_incoming_varargs): Create a new rtx for comparing the argument pointer against zero.
* config/i960/i960.c (i960_setup_incoming_varargs): Create a new rtx for comparing the argument pointer against zero. (i960_va_start): Similarly. From-SVN: r57897
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i960/i960.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index bde6710..f353c72 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -2552,16 +2552,20 @@ i960_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
if (cum->ca_nstackparms == 0 && first_reg < NPARM_REGS && !no_rtl)
{
rtx label = gen_label_rtx ();
- rtx regblock;
+ rtx regblock, fake_arg_pointer_rtx;
- /* If arg_pointer_rtx == 0, no arguments were passed on the stack
+ /* Use a different rtx than arg_pointer_rtx so that cse and friends
+ can go on believing that the argument pointer can never be zero. */
+ fake_arg_pointer_rtx = gen_raw_REG (Pmode, ARG_POINTER_REGNUM);
+
+ /* If the argument pointer is 0, no arguments were passed on the stack
and we need to allocate a chunk to save the registers (if any
arguments were passed on the stack the caller would allocate the
48 bytes as well). We must allocate all 48 bytes (12*4) because
va_start assumes it. */
- emit_insn (gen_cmpsi (arg_pointer_rtx, const0_rtx));
+ emit_insn (gen_cmpsi (fake_arg_pointer_rtx, const0_rtx));
emit_jump_insn (gen_bne (label));
- emit_insn (gen_rtx_SET (VOIDmode, arg_pointer_rtx,
+ emit_insn (gen_rtx_SET (VOIDmode, fake_arg_pointer_rtx,
stack_pointer_rtx));
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
memory_address (SImode,
@@ -2598,6 +2602,7 @@ i960_va_start (valist, nextarg)
rtx nextarg ATTRIBUTE_UNUSED;
{
tree s, t, base, num;
+ rtx fake_arg_pointer_rtx;
/* The array type always decays to a pointer before we get here, so we
can't use ARRAY_REF. */
@@ -2606,7 +2611,10 @@ i960_va_start (valist, nextarg)
build (PLUS_EXPR, unsigned_type_node, valist,
TYPE_SIZE_UNIT (TREE_TYPE (valist))));
- s = make_tree (unsigned_type_node, arg_pointer_rtx);
+ /* Use a different rtx than arg_pointer_rtx so that cse and friends
+ can go on believing that the argument pointer can never be zero. */
+ fake_arg_pointer_rtx = gen_raw_REG (Pmode, ARG_POINTER_REGNUM);
+ s = make_tree (unsigned_type_node, fake_arg_pointer_rtx);
t = build (MODIFY_EXPR, unsigned_type_node, base, s);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);