1 2002-08-17 H.J. Lu <hjl@gnu.org>
3 * calls.c (PUSH_ARGS_REVERSED): Define only if not defined.
4 * expr.c (PUSH_ARGS_REVERSED): Likewise.
6 2002-07-26 H.J. Lu <hjl@gnu.org>
8 * config/i386/i386.h (PUSH_ARGS_REVERSED): Set to 1.
10 --- gcc/calls.c.var Thu Apr 4 15:28:47 2002
11 +++ gcc/calls.c Sat Aug 17 22:45:46 2002
12 @@ -46,9 +46,11 @@ Software Foundation, 59 Temple Place - S
16 +#ifndef PUSH_ARGS_REVERSED
17 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
18 #define PUSH_ARGS_REVERSED PUSH_ARGS
24 --- gcc/config/i386/i386.h.var Sun Jul 14 23:54:36 2002
25 +++ gcc/config/i386/i386.h Sat Aug 17 19:03:21 2002
26 @@ -1581,6 +1581,10 @@ enum reg_class
28 #define PUSH_ARGS (TARGET_PUSH_ARGS && !ACCUMULATE_OUTGOING_ARGS)
30 +/* We want the stack and args grow in opposite directions, even if
32 +#define PUSH_ARGS_REVERSED 1
34 /* Offset of first parameter from the argument pointer register value. */
35 #define FIRST_PARM_OFFSET(FNDECL) 0
37 --- gcc/expr.c.var Mon May 6 22:43:11 2002
38 +++ gcc/expr.c Sat Aug 17 22:52:27 2002
39 @@ -54,9 +54,11 @@ Software Foundation, 59 Temple Place - S
43 +#ifndef PUSH_ARGS_REVERSED
44 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
45 #define PUSH_ARGS_REVERSED /* If it's last to first. */
51 2002-08-18 H.J. Lu <hjl@gnu.org>
53 * calls.c (store_one_arg): Remove ATTRIBUTE_UNUSED on
54 variable_size. Mark any slots used for the argument as in-use
55 only if we can't pass all arguments to a library call in
58 --- gcc/calls.c.copy Sun Aug 18 07:35:11 2002
59 +++ gcc/calls.c Sun Aug 18 08:27:29 2002
60 @@ -4270,7 +4270,7 @@ store_one_arg (arg, argblock, flags, var
64 - int variable_size ATTRIBUTE_UNUSED;
66 int reg_parm_stack_space;
68 tree pval = arg->tree_value;
69 @@ -4345,14 +4345,22 @@ store_one_arg (arg, argblock, flags, var
70 emit_move_insn (arg->save_area, stack_area);
74 + /* Now that we have saved any slots that will be overwritten
75 + by this store, mark all slots this store will use. We
76 + must do this before we actually expand the argument since
77 + the expansion itself may trigger library calls which might
78 + need to use the same stack slot. We only do it if we can't
79 + pass all arguments to a library call in registers. */
82 + for (i = lower_bound; i < upper_bound; i++)
83 + stack_usage_map[i] = 1;
85 + /* Set it so that we don't do it again. */
89 - /* Now that we have saved any slots that will be overwritten by this
90 - store, mark all slots this store will use. We must do this before
91 - we actually expand the argument since the expansion itself may
92 - trigger library calls which might need to use the same stack slot. */
93 - if (argblock && ! variable_size && arg->stack)
94 - for (i = lower_bound; i < upper_bound; i++)
95 - stack_usage_map[i] = 1;
98 /* If this isn't going to be placed on both the stack and in registers,
99 @@ -4579,6 +4587,11 @@ store_one_arg (arg, argblock, flags, var
100 arg->value = arg->stack_slot;
103 + if (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL)
104 + && argblock && ! variable_size && arg->stack)
105 + for (i = lower_bound; i < upper_bound; i++)
106 + stack_usage_map[i] = 1;
108 /* Once we have pushed something, pops can't safely
109 be deferred during the rest of the arguments. */