This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: function parms in reg patch
On Wed, May 07, 2003 at 11:14:21AM +0100, Richard Earnshaw wrote:
> The problem is that current_function_pretend_args_size is not being set up
> correctly. So we get the following assembler files:
Sorry for the breakage. Two silly bugs.
1) I reversed a condition accidentally.
2) When moving the arg size adjustment for partial in-regs args
into locate_and_pad_parm, I forgot to add it back for assign_parm.
We only want the part size in calls.c, but we need the full stack
slot in assign_parms.
* function.c (assign_parms): Correct reversed reg_parm_stack_space
test. Add partial in-regs size to stack size.
Is mopping up your own messes allowed under the obvious fix rule? :)
Otherwise, I'll need approval to commit this.
Index: gcc/function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.424
diff -u -p -r1.424 function.c
--- gcc/function.c 3 May 2003 21:44:27 -0000 1.424
+++ gcc/function.c 7 May 2003 12:42:39 -0000
@@ -4644,7 +4644,7 @@ assign_parms (fndecl)
/* When REG_PARM_STACK_SPACE is nonzero, stack space for
split parameters was allocated by our caller, so we
won't be pushing it in the prolog. */
- if (reg_parm_stack_space)
+ if (reg_parm_stack_space == 0)
#endif
current_function_pretend_args_size
= (((partial * UNITS_PER_WORD) + (PARM_BOUNDARY / BITS_PER_UNIT) - 1)
@@ -4694,6 +4694,9 @@ assign_parms (fndecl)
)
{
stack_args_size.constant += locate.size.constant;
+ /* locate.size doesn't include the part in regs. */
+ if (partial)
+ stack_args_size.constant += current_function_pretend_args_size;
if (locate.size.var)
ADD_PARM_SIZE (stack_args_size, locate.size.var);
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre