This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] Parameter passing fix


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

and a fix has been suggested in

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

Bootstrapped and regtested on sparc-sun-solaris2.7 with

and --enable-languages="c,c++,f77,objc" (libjava doesn't compile even
without the patch).



2001-07-03  Roman Lechtchinsky  <>

	* 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. */
        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),
  		            ARGS_SIZE_RTX (arg->alignment_pad));
- 	    size_rtx = GEN_INT (INTVAL(size_rtx) - reg_parm_stack_space);
--- 4639,4644 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]