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]

Strip unreachable code in fixup_var_refs_insn

This patch removes a large block of unreachable code from
fixup_var_refs_insn.  call_dest is always zero when we hit the first
if block inside the if (SMALL_REGISTER_CLASSES), so it will never do
anything interesting.

This code _used_ to do something useful when call_dest kept its value
across insns.  That was before fixup_var_refs_insn was split out.  It
has been nonfunctional since this change:

2001-01-20  Zack Weinberg  <>

        * function.c (fixup_var_refs_insns): Break up into
        fixup_var_refs_insn [body of loop], fixup_var_refs_insns
        [loop over entire insn list], and fixup_var_refs_insns_with_hash
        [loop over hash table entries].
        (fixup_var_refs): Adjust calls to fixup_var_refs_insns and/or
        fixup_var_refs_insns_with_hash, to match above changes.

As that change caused no regressions and there have been no reports of
problems since, I conclude that this block is no longer necessary.

Bootstrapped i386-linux (which defines SMALL_REGISTER_CLASSES).  OK
for trunk?


	* function.c (fixup_var_refs_insn): Delete if (SMALL_REGISTER_CLASSES)
	block, which never does anything useful.  Delete now-unused variable.

Index: function.c
--- function.c	2001/02/24 13:15:55	1.253
+++ function.c	2001/02/28 01:15:01
@@ -1709,7 +1709,6 @@ fixup_var_refs_insn (insn, var, promoted
      int unsignedp;
      int toplevel;
-  rtx call_dest = 0;
   rtx set, prev, prev_set;
   rtx note;
@@ -1769,44 +1768,6 @@ fixup_var_refs_insn (insn, var, promoted
       struct fixup_replacement *replacements = 0;
       rtx next_insn = NEXT_INSN (insn);
-	{
-	  /* If the insn that copies the results of a CALL_INSN
-	     into a pseudo now references VAR, we have to use an
-	     intermediate pseudo since we want the life of the
-	     return value register to be only a single insn.
-	     If we don't use an intermediate pseudo, such things as
-	     address computations to make the address of VAR valid
-	     if it is not can be placed between the CALL_INSN and INSN.
-	     To make sure this doesn't happen, we record the destination
-	     of the CALL_INSN and see if the next insn uses both that
-	     and VAR.  */
-	  if (call_dest != 0 && GET_CODE (insn) == INSN
-	      && reg_mentioned_p (var, PATTERN (insn))
-	      && reg_mentioned_p (call_dest, PATTERN (insn)))
-	    {
-	      rtx temp = gen_reg_rtx (GET_MODE (call_dest));
-	      emit_insn_before (gen_move_insn (temp, call_dest), insn);
-	      PATTERN (insn) = replace_rtx (PATTERN (insn),
-					    call_dest, temp);
-	    }
-	  if (GET_CODE (insn) == CALL_INSN
-	      && GET_CODE (PATTERN (insn)) == SET)
-	    call_dest = SET_DEST (PATTERN (insn));
-	  else if (GET_CODE (insn) == CALL_INSN
-		   && GET_CODE (PATTERN (insn)) == PARALLEL
-		   && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == SET)
-	    call_dest = SET_DEST (XVECEXP (PATTERN (insn), 0, 0));
-	  else
-	    call_dest = 0;
-	}
       /* See if we have to do anything to INSN now that VAR is in
 	 memory.  If it needs to be loaded into a pseudo, use a single

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