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]

[4.1 patch] Delete old #if 0 code in reload


So I was getting a little tired of the presence of old disabled code.

Should any of this be kept?

Or is the OK for 4.1?

	* reload.c: Remove code #if 0-ed out in 2000 or earlier.
	* reload1.c: Remove code #if 0-ed out in 2000 or earlier.

Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.260
diff -u -p -r1.260 reload.c
--- reload.c	7 Dec 2004 01:14:40 -0000	1.260
+++ reload.c	14 Dec 2004 18:41:31 -0000
@@ -1430,27 +1430,6 @@ push_reload (rtx in, rtx out, rtx *inloc
   if (in != 0 && in != *inloc)
     rld[i].nocombine = 1;
 
-#if 0
-  /* This was replaced by changes in find_reloads_address_1 and the new
-     function inc_for_reload, which go with a new meaning of reload_inc.  */
-
-  /* If this is an IN/OUT reload in an insn that sets the CC,
-     it must be for an autoincrement.  It doesn't work to store
-     the incremented value after the insn because that would clobber the CC.
-     So we must do the increment of the value reloaded from,
-     increment it, store it back, then decrement again.  */
-  if (out != 0 && sets_cc0_p (PATTERN (this_insn)))
-    {
-      out = 0;
-      rld[i].out = 0;
-      rld[i].inc = find_inc_amount (PATTERN (this_insn), in);
-      /* If we did not find a nonzero amount-to-increment-by,
-	 that contradicts the belief that IN is being incremented
-	 in an address in this insn.  */
-      gcc_assert (rld[i].inc != 0);
-    }
-#endif
-
   /* If we will replace IN and OUT with the reload-reg,
      record where they are located so that substitution need
      not do a tree walk.  */
@@ -4081,32 +4060,6 @@ find_reloads (rtx insn, int replace, int
 	dup_replacements (recog_data.dup_loc[i], recog_data.operand_loc[opno]);
       }
 
-#if 0
-  /* This loses because reloading of prior insns can invalidate the equivalence
-     (or at least find_equiv_reg isn't smart enough to find it any more),
-     causing this insn to need more reload regs than it needed before.
-     It may be too late to make the reload regs available.
-     Now this optimization is done safely in choose_reload_regs.  */
-
-  /* For each reload of a reg into some other class of reg,
-     search for an existing equivalent reg (same value now) in the right class.
-     We can use it as long as we don't need to change its contents.  */
-  for (i = 0; i < n_reloads; i++)
-    if (rld[i].reg_rtx == 0
-	&& rld[i].in != 0
-	&& REG_P (rld[i].in)
-	&& rld[i].out == 0)
-      {
-	rld[i].reg_rtx
-	  = find_equiv_reg (rld[i].in, insn, rld[i].class, -1,
-			    static_reload_reg_p, 0, rld[i].inmode);
-	/* Prevent generation of insn to load the value
-	   because the one we found already has the value.  */
-	if (rld[i].reg_rtx)
-	  rld[i].in = rld[i].reg_rtx;
-      }
-#endif
-
   /* Perhaps an output reload can be combined with another
      to reduce needs by one.  */
   if (!goal_earlyclobber)
@@ -4484,12 +4437,6 @@ find_reloads_toplev (rtx x, int opnum, e
       int regno = REGNO (x);
       if (reg_equiv_constant[regno] != 0 && !is_set_dest)
 	x = reg_equiv_constant[regno];
-#if 0
-      /*  This creates (subreg (mem...)) which would cause an unnecessary
-	  reload of the mem.  */
-      else if (reg_equiv_mem[regno] != 0)
-	x = reg_equiv_mem[regno];
-#endif
       else if (reg_equiv_memory_loc[regno]
 	       && (reg_equiv_address[regno] != 0 || num_not_at_initial_offset))
 	{
@@ -5687,17 +5634,6 @@ find_reloads_address_1 (enum machine_mod
 	    return 1;
 	  }
 
-#if 0 /* This might screw code in reload1.c to delete prior output-reload
-	 that feeds this insn.  */
-	if (reg_equiv_mem[regno] != 0)
-	  {
-	    push_reload (reg_equiv_mem[regno], NULL_RTX, loc, (rtx*) 0,
-			 context_reg_class,
-			 GET_MODE (x), VOIDmode, 0, 0, opnum, type);
-	    return 1;
-	  }
-#endif
-
 	if (reg_equiv_memory_loc[regno]
 	    && (reg_equiv_address[regno] != 0 || num_not_at_initial_offset))
 	  {
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.455
diff -u -p -r1.455 reload1.c
--- reload1.c	26 Nov 2004 02:04:09 -0000	1.455
+++ reload1.c	14 Dec 2004 18:41:36 -0000
@@ -5320,22 +5320,6 @@ choose_reload_regs (struct insn_chain *c
 		      && true_regnum (rld[r].in) < FIRST_PSEUDO_REGISTER)))
 	    continue;
 
-#if 0 /* No longer needed for correct operation.
-	 It might give better code, or might not; worth an experiment?  */
-	  /* If this is an optional reload, we can't inherit from earlier insns
-	     until we are sure that any non-optional reloads have been allocated.
-	     The following code takes advantage of the fact that optional reloads
-	     are at the end of reload_order.  */
-	  if (rld[r].optional != 0)
-	    for (i = 0; i < j; i++)
-	      if ((rld[reload_order[i]].out != 0
-		   || rld[reload_order[i]].in != 0
-		   || rld[reload_order[i]].secondary_p)
-		  && ! rld[reload_order[i]].optional
-		  && rld[reload_order[i]].reg_rtx == 0)
-		allocate_reload_reg (chain, reload_order[i], 0);
-#endif
-
 	  /* First see if this pseudo is already available as reloaded
 	     for a previous insn.  We cannot try to inherit for reloads
 	     that are smaller than the maximum number of registers needed
@@ -5389,14 +5373,6 @@ choose_reload_regs (struct insn_chain *c
 		  rld[r].out = rld[r].in;
 		}
 #endif
-#if 0
-	      /* This won't work, since REGNO can be a pseudo reg number.
-		 Also, it takes much more hair to keep track of all the things
-		 that can invalidate an inherited reload of part of a pseudoreg.  */
-	      else if (GET_CODE (rld[r].in) == SUBREG
-		       && REG_P (SUBREG_REG (rld[r].in)))
-		regno = subreg_regno (rld[r].in);
-#endif
 
 	      if (regno >= 0 && reg_last_reload_reg[regno] != 0)
 		{
@@ -5720,41 +5696,6 @@ choose_reload_regs (struct insn_chain *c
 	     reload, we are done.  */
 	  if (rld[r].reg_rtx != 0 || rld[r].optional != 0)
 	    continue;
-
-#if 0
-	  /* No longer needed for correct operation.  Might or might
-	     not give better code on the average.  Want to experiment?  */
-
-	  /* See if there is a later reload that has a class different from our
-	     class that intersects our class or that requires less register
-	     than our reload.  If so, we must allocate a register to this
-	     reload now, since that reload might inherit a previous reload
-	     and take the only available register in our class.  Don't do this
-	     for optional reloads since they will force all previous reloads
-	     to be allocated.  Also don't do this for reloads that have been
-	     turned off.  */
-
-	  for (i = j + 1; i < n_reloads; i++)
-	    {
-	      int s = reload_order[i];
-
-	      if ((rld[s].in == 0 && rld[s].out == 0
-		   && ! rld[s].secondary_p)
-		  || rld[s].optional)
-		continue;
-
-	      if ((rld[s].class != rld[r].class
-		   && reg_classes_intersect_p (rld[r].class,
-					       rld[s].class))
-		  || rld[s].nregs < rld[r].nregs)
-		break;
-	    }
-
-	  if (i == n_reloads)
-	    continue;
-
-	  allocate_reload_reg (chain, r, j == n_reloads - 1);
-#endif
 	}
 
       /* Now allocate reload registers for anything non-optional that
@@ -6825,13 +6766,7 @@ do_input_reload (struct insn_chain *chai
       && rl->reg_rtx
       && REG_P (rl->reg_rtx)
       && spill_reg_store[REGNO (rl->reg_rtx)] != 0
-#if 0
-      /* There doesn't seem to be any reason to restrict this to pseudos
-	 and doing so loses in the case where we are copying from a
-	 register of the wrong class.  */
-      && (REGNO (spill_reg_stored_to[REGNO (rl->reg_rtx)])
-	  >= FIRST_PSEUDO_REGISTER)
-#endif
+
       /* The insn might have already some references to stackslots
 	 replaced by MEMs, while reload_out_reg still names the
 	 original pseudo.  */

-- 
This space intentionally left blank.


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