This is the mail archive of the gcc-patches@gcc.gnu.org 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]
Other format: [Raw text]

Re: RFA: Fix compat/struct-by-value tests for big endian targets (Was: function parms in regs, patch 2 of 3)


On Thu, May 15, 2003 at 06:09:28PM +0100, Joern Rennecke wrote:
> 	* function.c (assign_parms): Don't shift by word size nor
> 	clobber the stack for 0 sized arguments.
> 
> Index: function.c
> ===================================================================
> RCS file: /cvsroot/gcc/gcc/gcc/function.c,v
> retrieving revision 1.427
> diff -p -r1.427 function.c
> *** function.c	11 May 2003 19:21:31 -0000	1.427
> --- function.c	15 May 2003 16:43:30 -0000
> *************** assign_parms (fndecl)
> *** 4818,4823 ****
> --- 4818,4824 ----
>   		     to memory.  Note that the previous test doesn't
>   		     handle all cases (e.g. SIZE == 3).  */
>   		  else if (size != UNITS_PER_WORD
> + 			   && size != 0
>   			   && BYTES_BIG_ENDIAN)
>   		    {
>   		      rtx tem, x;

Oops, sorry.  This code was moved from move_block_from_reg, where there
was a test for nregs == 0, or equivalently, size == 0, before anything
was done.  I think it would make sense to do the zero size test earlier,
perhaps even before the emit_group_store call.

Index: gcc/function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.427
diff -u -p -r1.427 function.c
--- gcc/function.c	11 May 2003 19:21:31 -0000	1.427
+++ gcc/function.c	16 May 2003 00:16:25 -0000
@@ -4800,6 +4800,9 @@ assign_parms (fndecl)
 	      if (GET_CODE (entry_parm) == PARALLEL)
 		emit_group_store (mem, entry_parm, size);
 
+	      else if (size == 0)
+		;
+
 	      /* If SIZE is that of a mode no bigger than a word, just use
 		 that mode's store operation.  */
 	      else if (size <= UNITS_PER_WORD)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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