aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorChandrakala Chavva <cchavva@redhat.com>2000-12-27 20:51:55 -0500
committerChandra Chavva <cchavva@gcc.gnu.org>2000-12-27 20:51:55 -0500
commit57ec4709990925b193319480f1dd4d44ec37e903 (patch)
tree7bf4b9fa1674c595e43561ebd1c5af02c3875042 /gcc/calls.c
parentbc53668ead944505e9474544ed35d1abb6e5fceb (diff)
downloadgcc-57ec4709990925b193319480f1dd4d44ec37e903.zip
gcc-57ec4709990925b193319480f1dd4d44ec37e903.tar.gz
gcc-57ec4709990925b193319480f1dd4d44ec37e903.tar.bz2
calls.c (store_one_arg): If parm is passed both in stack and in register and offset is greater than...
* calls.c (store_one_arg): If parm is passed both in stack and in register and offset is greater than reg_parm_stack_space, split the offset and call emit_push_insn(). From-SVN: r38503
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 9513c30..51d5566 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -4535,6 +4535,30 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
}
}
+ /* If parm is passed both in stack and in register and offset is
+ greater than reg_parm_stack_space, split the offset. */
+ if (arg->reg && arg->pass_on_stack)
+ {
+ if (arg->offset.constant < reg_parm_stack_space && arg->offset.var)
+ error ("variable offset is passed paritially in stack and in reg");
+ else if (arg->offset.constant < reg_parm_stack_space && arg->size.var)
+ error ("variable size is passed partially in stack and in reg");
+ else if (arg->offset.constant < reg_parm_stack_space
+ && ((arg->offset.constant + arg->size.constant)
+ > reg_parm_stack_space))
+ {
+ rtx size_rtx1 = GEN_INT (reg_parm_stack_space - arg->offset.constant);
+ emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx1,
+ TYPE_ALIGN (TREE_TYPE (pval)) / BITS_PER_UNIT,
+ partial, reg, excess, argblock,
+ ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
+ ARGS_SIZE_RTX (arg->alignment_pad));
+
+ size_rtx = GEN_INT (INTVAL(size_rtx) - reg_parm_stack_space);
+ }
+ }
+
+
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx,
TYPE_ALIGN (TREE_TYPE (pval)), partial, reg, excess,
argblock, ARGS_SIZE_RTX (arg->offset),