This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Parameter passing fix
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] Parameter passing fix
- From: Roman Lechtchinsky <rl at cs dot tu-berlin dot de>
- Date: Tue, 3 Jul 2001 18:07:31 +0200 (MET DST)
Hi,
this patch fixes a problem with parameter passing on the T3E. The problem
is that GCC will use memcpy to copy large BLKmode arguments to the stack.
Unfortunately, arguments to memcpy might occupy the same stack space as
the argument which is to be copied. This problem is described in more
detail in
http://gcc.gnu.org/ml/gcc/2000-04/msg00066.html
and a fix has been suggested in
http://gcc.gnu.org/ml/gcc-patches/2000-12/msg01279.html.
This patch makes it work on the Cray T3E also. It would be really nice
someone could test it one PowerPC and M88K (which is the only other target
to define STACK_PARMS_IN_REG_PARM_AREA).
Bootstrapped and regtested on sparc-sun-solaris2.7 with
http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01619.html
and --enable-languages="c,c++,f77,objc" (libjava doesn't compile even
without the patch).
Bye
Roman
2001-07-03 Roman Lechtchinsky <rl@cs.tu-berlin.de>
* calls.c (store_one_arg): Make sure that the entire argument is
pushed if STACK_PARMS_IN_REG_PARM_AREA is defined.
Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.185
diff -c -3 -p -r1.185 calls.c
*** calls.c 2001/05/05 01:30:51 1.185
--- calls.c 2001/07/03 15:44:54
*************** store_one_arg (arg, argblock, flags, var
*** 4619,4625 ****
--- 4619,4629 ----
/* If parm is passed both in stack and in register and offset is
greater than reg_parm_stack_space, split the offset. */
+ #ifndef STACK_PARMS_IN_REG_PARM_AREA
if (arg->reg && arg->pass_on_stack)
+ #else
+ if (1)
+ #endif
{
if (arg->offset.constant < reg_parm_stack_space && arg->offset.var)
error ("variable offset is passed paritially in stack and in reg");
*************** store_one_arg (arg, argblock, flags, var
*** 4635,4642 ****
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);
}
}
--- 4639,4644 ----