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]

[reload-branch]: Remove some unused variables


I've committed this patch to remove a few unused variables.


Bernd
	* reload.c (find_reloads): Remove RELOAD_REG_P argument.  All callers
	changed.
	* reload.h (find_reloads): Update prototype.
	* reload1.c (n_spills, spill_reg_order, spill_regs): Delete variables.
	(finish_spills): Don't set any of them.

Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.268.6.1
diff -c -p -r1.268.6.1 reload.c
*** reload.c	18 Mar 2005 18:40:32 -0000	1.268.6.1
--- reload.c	7 Apr 2005 11:15:45 -0000
*************** static int address_changed;
*** 1871,1887 ****
     we are called from global_alloc but false when stupid register
     allocation has been done.
  
-    RELOAD_REG_P if nonzero is a vector indexed by hard reg number
-    which is nonnegative if the reg has been commandeered for reloading into.
-    It is copied into STATIC_RELOAD_REG_P and referenced from there
-    by various subroutines.
- 
     Return TRUE if some operands need to be changed, because of swapping
     commutative operands, reg_equiv_address substitution, or whatever.  */
  
  int
  find_reloads (struct insn_chain *chain, rtx insn, int ind_levels,
! 	      int live_known, short *reload_reg_p)
  {
    int insn_code_number;
    int i, j;
--- 1871,1882 ----
     we are called from global_alloc but false when stupid register
     allocation has been done.
  
     Return TRUE if some operands need to be changed, because of swapping
     commutative operands, reg_equiv_address substitution, or whatever.  */
  
  int
  find_reloads (struct insn_chain *chain, rtx insn, int ind_levels,
! 	      int live_known)
  {
    int insn_code_number;
    int i, j;
*************** find_reloads (struct insn_chain *chain, 
*** 2117,2124 ****
  		  || GET_CODE (recog_data.operand[i]) == PLUS))
  	    {
  	      INSN_CODE (insn) = -1;
! 	      retval = find_reloads (chain, insn, ind_levels, live_known,
! 				     reload_reg_p);
  	      return retval;
  	    }
  
--- 2112,2118 ----
  		  || GET_CODE (recog_data.operand[i]) == PLUS))
  	    {
  	      INSN_CODE (insn) = -1;
! 	      retval = find_reloads (chain, insn, ind_levels, live_known);
  	      return retval;
  	    }
  
Index: reload.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.h,v
retrieving revision 1.50.14.1
diff -c -p -r1.50.14.1 reload.h
*** reload.h	18 Mar 2005 18:40:33 -0000	1.50.14.1
--- reload.h	7 Apr 2005 11:15:45 -0000
*************** extern void compute_use_by_pseudos (HARD
*** 353,359 ****
  /* Search the body of INSN for values that need reloading and record them
     with push_reload.  REPLACE nonzero means record also where the values occur
     so that subst_reloads can be used.  */
! extern int find_reloads (struct insn_chain *, rtx, int, int, short *);
  
  #endif
  
--- 353,359 ----
  /* Search the body of INSN for values that need reloading and record them
     with push_reload.  REPLACE nonzero means record also where the values occur
     so that subst_reloads can be used.  */
! extern int find_reloads (struct insn_chain *, rtx, int, int);
  
  #endif
  
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.463.2.2
diff -c -p -r1.463.2.2 reload1.c
*** reload1.c	20 Mar 2005 19:49:08 -0000	1.463.2.2
--- reload1.c	7 Apr 2005 11:15:48 -0000
*************** static short *reg_old_renumber;
*** 118,140 ****
     call-saved.  */
  static HARD_REG_SET reg_reloaded_call_part_clobbered;
  
! /* Number of spill-regs so far; number of valid elements of spill_regs.  */
! static int n_spills;
! 
! /* In parallel with spill_regs, contains REG rtx's for those regs.
!    Holds the last rtx used for any given reg, or 0 if it has never
     been used for spilling yet.  This rtx is reused, provided it has
     the proper mode.  */
  static rtx spill_reg_rtx[FIRST_PSEUDO_REGISTER];
  
- /* This table is the inverse mapping of spill_regs:
-    indexed by hard reg number,
-    it contains the position of that reg in spill_regs,
-    or -1 for something that is not in spill_regs.
- 
-    ?!?  This is no longer accurate.  */
- static short spill_reg_order[FIRST_PSEUDO_REGISTER];
- 
  /* This reg set indicates registers that can't be used as spill registers for
     the currently processed insn.  These are the hard registers which are live
     during the insn, but not allocated to pseudos, as well as fixed
--- 118,128 ----
     call-saved.  */
  static HARD_REG_SET reg_reloaded_call_part_clobbered;
  
! /* Holds the last rtx used for any given reg, or 0 if it has never
     been used for spilling yet.  This rtx is reused, provided it has
     the proper mode.  */
  static rtx spill_reg_rtx[FIRST_PSEUDO_REGISTER];
  
  /* This reg set indicates registers that can't be used as spill registers for
     the currently processed insn.  These are the hard registers which are live
     during the insn, but not allocated to pseudos, as well as fixed
*************** static HARD_REG_SET bad_spill_regs;
*** 147,163 ****
     to retry register allocation.  */
  static HARD_REG_SET bad_spill_regs_global;
  
- /* Describes order of use of registers for reloading
-    of spilled pseudo-registers.  `n_spills' is the number of
-    elements that are actually valid; new ones are added at the end.
- 
-    Both spill_regs and spill_reg_order are used on two occasions:
-    once during find_reload_regs, where they keep track of the spill registers
-    for a single insn, but also during reload_as_needed where they show all
-    the registers ever used by reload.  For the latter case, the information
-    is calculated during finish_spills.  */
- static short spill_regs[FIRST_PSEUDO_REGISTER];
- 
  /* This vector of reg sets indicates, for each pseudo, which hard registers
     may not be used for retrying global allocation because the register was
     formerly spilled from one of them.  If we allowed reallocating a pseudo to
--- 135,140 ----
*************** calculate_needs_all_insns (int global)
*** 2379,2385 ****
  
  	  /* Analyze the instruction.  */
  	  operands_changed = find_reloads (chain, copy, spill_indirect_levels,
! 					   global, spill_reg_order);
  
  	  if (num_eliminable)
  	    update_eliminable_offsets ();
--- 2356,2362 ----
  
  	  /* Analyze the instruction.  */
  	  operands_changed = find_reloads (chain, copy, spill_indirect_levels,
! 					   global);
  
  	  if (num_eliminable)
  	    update_eliminable_offsets ();
*************** finish_spills (int global)
*** 5711,5728 ****
       register used by the call insn for the return PC is a call-used register,
       but must be saved by the prologue.  */
  
-   n_spills = 0;
    for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
      if (TEST_HARD_REG_BIT (used_spill_regs, i))
        {
- 	spill_reg_order[i] = n_spills;
- 	spill_regs[n_spills++] = i;
  	if (num_eliminable && ! regs_ever_live[i])
  	  something_changed = 1;
  	regs_ever_live[i] = 1;
        }
-     else
-       spill_reg_order[i] = -1;
  
    EXECUTE_IF_SET_IN_REG_SET (&spilled_pseudos, FIRST_PSEUDO_REGISTER, i, rsi)
      {
--- 5688,5700 ----
*************** reload_as_needed (int live_known)
*** 5929,5936 ****
  	     This info is returned in the tables reload_... (see reload.h).
  	     Also modify the body of INSN by substituting RELOAD
  	     rtx's for those pseudo regs.  */
! 	    find_reloads (chain, insn, spill_indirect_levels, live_known,
! 			  spill_reg_order);
  
  	  if (chain->n_reloads > 0)
  	    {
--- 5901,5907 ----
  	     This info is returned in the tables reload_... (see reload.h).
  	     Also modify the body of INSN by substituting RELOAD
  	     rtx's for those pseudo regs.  */
! 	    find_reloads (chain, insn, spill_indirect_levels, live_known);
  
  	  if (chain->n_reloads > 0)
  	    {

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