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]

[PATCH] Re: Your assign_parms changes


	Is it appropriate to use the same logic to update max_parm_reg and
parm_reg_stack_loc as elsewhere in assign_parms?

Thanks, David


	* function.c (assign_parms): Update max_parm_reg and
	parm_reg_stack_loc when adding new parm reg.

Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.478
diff -c -p -r1.478 function.c
*** function.c	16 Dec 2003 00:06:33 -0000	1.478
--- function.c	18 Dec 2003 03:19:21 -0000
*************** assign_parms (tree fndecl)
*** 4740,4748 ****
--- 4740,4766 ----
  
  	  if (REG_P (parmreg))
  	    {
+ 	      int regno = REGNO (parmreg);
+ 
  	      emit_group_store (parmreg, entry_parm, TREE_TYPE (parm),
  				int_size_in_bytes (TREE_TYPE (parm)));
  	      SET_DECL_RTL (parm, parmreg);
+ 
+ 	      if (regno >= max_parm_reg)
+ 		{
+ 		  rtx *new;
+ 		  int old_max_parm_reg = max_parm_reg;
+ 
+ 		  /* It's slow to expand this one register at a time,
+ 		     but it's also rare and we need max_parm_reg to be
+ 		     precisely correct.  */
+ 		  max_parm_reg = regno + 1;
+ 		  new = ggc_realloc (parm_reg_stack_loc,
+ 				     max_parm_reg * sizeof (rtx));
+ 		  memset (new + old_max_parm_reg, 0,
+ 			  (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
+ 		  parm_reg_stack_loc = new;
+ 		}
  	    }
  	}
  


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