summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-07-14 20:19:23 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-07-14 20:19:23 +0000
commit3ee3644ae9e55eb3e1673c40c7e89982dc896a9d (patch)
tree66e6a31f665ceb5f1070506656e3a7ec8aaf264d /gcc/calls.c
parent596f6ef42fa525ae7a2f836648cd89c173fb1275 (diff)
downloadgcc-3ee3644ae9e55eb3e1673c40c7e89982dc896a9d.tar.gz
* calls.c (emit_library_call): Use right index into argvec array
when iterating over arguments which need to be pushed on the stack. (emit_library_call_value): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14444 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 6a753d35b6d..52d5cd7684e 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2552,6 +2552,8 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
/* Push the args that need to be pushed. */
+ /* ARGNUM indexes the ARGVEC array in the order in which the arguments
+ are to be pushed. */
for (count = 0; count < nargs; count++, argnum += inc)
{
register enum machine_mode mode = argvec[argnum].mode;
@@ -2569,11 +2571,11 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
#ifdef ARGS_GROW_DOWNWARD
/* stack_slot is negative, but we want to index stack_usage_map
with positive values. */
- upper_bound = -argvec[count].offset.constant + 1;
- lower_bound = upper_bound - argvec[count].size.constant;
+ upper_bound = -argvec[argnum].offset.constant + 1;
+ lower_bound = upper_bound - argvec[argnum].size.constant;
#else
- lower_bound = argvec[count].offset.constant;
- upper_bound = lower_bound + argvec[count].size.constant;
+ lower_bound = argvec[argnum].offset.constant;
+ upper_bound = lower_bound + argvec[argnum].size.constant;
#endif
for (i = lower_bound; i < upper_bound; i++)
@@ -2590,18 +2592,18 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
{
/* We need to make a save area. See what mode we can make it. */
enum machine_mode save_mode
- = mode_for_size (argvec[count].size.constant * BITS_PER_UNIT,
+ = mode_for_size (argvec[argnum].size.constant * BITS_PER_UNIT,
MODE_INT, 1);
rtx stack_area
= gen_rtx (MEM, save_mode,
memory_address (save_mode, plus_constant (argblock,
- argvec[count].offset.constant)));
- argvec[count].save_area = gen_reg_rtx (save_mode);
- emit_move_insn (argvec[count].save_area, stack_area);
+ argvec[argnum].offset.constant)));
+ argvec[argnum].save_area = gen_reg_rtx (save_mode);
+ emit_move_insn (argvec[argnum].save_area, stack_area);
}
#endif
emit_push_insn (val, mode, NULL_TREE, NULL_RTX, 0, partial, reg, 0,
- argblock, GEN_INT (argvec[count].offset.constant));
+ argblock, GEN_INT (argvec[argnum].offset.constant));
#ifdef ACCUMULATE_OUTGOING_ARGS
/* Now mark the segment we just used. */
@@ -2633,6 +2635,8 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
/* Now load any reg parms into their regs. */
+ /* ARGNUM indexes the ARGVEC array in the order in which the arguments
+ are to be pushed. */
for (count = 0; count < nargs; count++, argnum += inc)
{
register enum machine_mode mode = argvec[argnum].mode;
@@ -3117,6 +3121,8 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
/* Push the args that need to be pushed. */
+ /* ARGNUM indexes the ARGVEC array in the order in which the arguments
+ are to be pushed. */
for (count = 0; count < nargs; count++, argnum += inc)
{
register enum machine_mode mode = argvec[argnum].mode;
@@ -3134,11 +3140,11 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
#ifdef ARGS_GROW_DOWNWARD
/* stack_slot is negative, but we want to index stack_usage_map
with positive values. */
- upper_bound = -argvec[count].offset.constant + 1;
- lower_bound = upper_bound - argvec[count].size.constant;
+ upper_bound = -argvec[argnum].offset.constant + 1;
+ lower_bound = upper_bound - argvec[argnum].size.constant;
#else
- lower_bound = argvec[count].offset.constant;
- upper_bound = lower_bound + argvec[count].size.constant;
+ lower_bound = argvec[argnum].offset.constant;
+ upper_bound = lower_bound + argvec[argnum].size.constant;
#endif
for (i = lower_bound; i < upper_bound; i++)
@@ -3155,18 +3161,18 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
{
/* We need to make a save area. See what mode we can make it. */
enum machine_mode save_mode
- = mode_for_size (argvec[count].size.constant * BITS_PER_UNIT,
+ = mode_for_size (argvec[argnum].size.constant * BITS_PER_UNIT,
MODE_INT, 1);
rtx stack_area
= gen_rtx (MEM, save_mode,
memory_address (save_mode, plus_constant (argblock,
- argvec[count].offset.constant)));
- argvec[count].save_area = gen_reg_rtx (save_mode);
- emit_move_insn (argvec[count].save_area, stack_area);
+ argvec[argnum].offset.constant)));
+ argvec[argnum].save_area = gen_reg_rtx (save_mode);
+ emit_move_insn (argvec[argnum].save_area, stack_area);
}
#endif
emit_push_insn (val, mode, NULL_TREE, NULL_RTX, 0, partial, reg, 0,
- argblock, GEN_INT (argvec[count].offset.constant));
+ argblock, GEN_INT (argvec[argnum].offset.constant));
#ifdef ACCUMULATE_OUTGOING_ARGS
/* Now mark the segment we just used. */
@@ -3198,6 +3204,8 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
/* Now load any reg parms into their regs. */
+ /* ARGNUM indexes the ARGVEC array in the order in which the arguments
+ are to be pushed. */
for (count = 0; count < nargs; count++, argnum += inc)
{
register enum machine_mode mode = argvec[argnum].mode;