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]

replace delete_related_inssn by delete_insn on most places



Hi,
this patch replaces some delete_related_insns by delete_insn
where I am sure only one insn should be removed.  Also it fixes
loop.c to avoid removing notes repositioned to other insn (this
is needed for my next patch.)

Bootstrapped/regtested i386

Honza

Sat Sep 22 17:20:54 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* gcse.c (replace_store_insn): Use delete_insn.
	* loop.c (move_movables): Likewise; avoid delete_insn
	from clobbering notes moved elsewhere.
	(check_dbra_loop): Use delete_insn.
	* ssa.c (convert_from_ssa): Likewise.

*** /p2/cfg9/egcs/gcc/gcse.c	Thu Sep 20 18:33:13 2001
--- gcse.c	Sat Sep 22 15:55:20 2001
*************** replace_store_insn (reg, del, bb)
*** 6836,6842 ****
        fprintf(gcse_file, "\n");
      }
    
!   delete_related_insns (del);
  }
  
  
--- 6834,6840 ----
        fprintf(gcse_file, "\n");
      }
    
!   delete_insn (del);
  }
*** /p2/cfg9/egcs/gcc/loop.c	Thu Sep 20 18:33:14 2001
--- loop.c	Sat Sep 22 15:48:20 2001
*************** move_movables (loop, movables, threshold
*** 1774,1780 ****
  		    = gen_rtx_EXPR_LIST (VOIDmode, r1,
  					 gen_rtx_EXPR_LIST (VOIDmode, r2,
  							    regs_may_share));
! 		  delete_related_insns (m->insn);
  
  		  if (new_start == 0)
  		    new_start = i1;
--- 1772,1778 ----
  		    = gen_rtx_EXPR_LIST (VOIDmode, r1,
  					 gen_rtx_EXPR_LIST (VOIDmode, r2,
  							    regs_may_share));
! 		  delete_insn (m->insn);
  
  		  if (new_start == 0)
  		    new_start = i1;
*************** move_movables (loop, movables, threshold
*** 1805,1815 ****
  			{
  			  temp = XEXP (temp, 0);
  			  while (temp != p)
! 			    temp = delete_related_insns (temp);
  			}
  
  		      temp = p;
! 		      p = delete_related_insns (p);
  
  		      /* simplify_giv_expr expects that it can walk the insns
  			 at m->insn forwards and see this old sequence we are
--- 1803,1813 ----
  			{
  			  temp = XEXP (temp, 0);
  			  while (temp != p)
! 			    temp = delete_insn (temp);
  			}
  
  		      temp = p;
! 		      p = delete_insn (p);
  
  		      /* simplify_giv_expr expects that it can walk the insns
  			 at m->insn forwards and see this old sequence we are
*************** move_movables (loop, movables, threshold
*** 1936,1942 ****
  			      if (temp == fn_address_insn)
  				fn_address_insn = i1;
  			      REG_NOTES (i1) = REG_NOTES (temp);
! 			      delete_related_insns (temp);
  			    }
  			  if (new_start == 0)
  			    new_start = first;
--- 1934,1941 ----
  			      if (temp == fn_address_insn)
  				fn_address_insn = i1;
  			      REG_NOTES (i1) = REG_NOTES (temp);
! 			      REG_NOTES (temp) = NULL;
! 			      delete_insn (temp);
  			    }
  			  if (new_start == 0)
  			    new_start = first;
*************** move_movables (loop, movables, threshold
*** 2001,2006 ****
--- 2000,2006 ----
  		      if (REG_NOTES (i1) == 0)
  			{
  			  REG_NOTES (i1) = REG_NOTES (p);
+ 			  REG_NOTES (p) = NULL;
  
  			  /* If there is a REG_EQUAL note present whose value
  			     is not loop invariant, then delete it, since it
*************** move_movables (loop, movables, threshold
*** 2031,2037 ****
  			}
  
  		      temp = p;
! 		      delete_related_insns (p);
  		      p = NEXT_INSN (p);
  
  		      /* simplify_giv_expr expects that it can walk the insns
--- 2031,2037 ----
  			}
  
  		      temp = p;
! 		      delete_insn (p);
  		      p = NEXT_INSN (p);
  
  		      /* simplify_giv_expr expects that it can walk the insns
*************** move_movables (loop, movables, threshold
*** 2103,2118 ****
  			 and prevent further processing of it.  */
  		      m1->done = 1;
  
! 		      /* if library call, delete all insn except last, which
! 			 is deleted below */
  		      if ((temp = find_reg_note (m1->insn, REG_RETVAL,
  						 NULL_RTX)))
! 			{
! 			  for (temp = XEXP (temp, 0); temp != m1->insn;
! 			       temp = NEXT_INSN (temp))
! 			    delete_related_insns (temp);
! 			}
! 		      delete_related_insns (m1->insn);
  
  		      /* Any other movable that loads the same register
  			 MUST be moved.  */
--- 2103,2114 ----
  			 and prevent further processing of it.  */
  		      m1->done = 1;
  
! 		      /* if library call, delete all insns.  */
  		      if ((temp = find_reg_note (m1->insn, REG_RETVAL,
  						 NULL_RTX)))
! 			delete_insn_chain (XEXP (temp, 0), m1->insn);
! 		      else
! 		        delete_insn (m1->insn);
  
  		      /* Any other movable that loads the same register
  			 MUST be moved.  */
*************** check_dbra_loop (loop, insn_count)
*** 7628,7634 ****
  	      end_sequence ();
  
  	      p = loop_insn_emit_before (loop, 0, bl->biv->insn, tem);
! 	      delete_related_insns (bl->biv->insn);
  
  	      /* Update biv info to reflect its new status.  */
  	      bl->biv->insn = p;
--- 7624,7630 ----
  	      end_sequence ();
  
  	      p = loop_insn_emit_before (loop, 0, bl->biv->insn, tem);
! 	      delete_insn (bl->biv->insn);
  
  	      /* Update biv info to reflect its new status.  */
  	      bl->biv->insn = p;
*** /p2/cfg9/egcs/gcc/ssa.c	Thu Sep 20 18:33:14 2001
--- ssa.c	Sat Sep 22 13:47:21 2001
*************** convert_from_ssa()
*** 2186,2192 ****
  	    {
  	      if (insn == BLOCK_END (bb))
  		BLOCK_END (bb) = PREV_INSN (insn);
! 	      insn = delete_related_insns (insn);
  	    }
  	  /* Since all the phi nodes come at the beginning of the
  	     block, if we find an ordinary insn, we can stop looking
--- 2186,2192 ----
  	    {
  	      if (insn == BLOCK_END (bb))
  		BLOCK_END (bb) = PREV_INSN (insn);
! 	      insn = delete_insn (insn);
  	    }
  	  /* Since all the phi nodes come at the beginning of the
  	     block, if we find an ordinary insn, we can stop looking
*** /p2/cfg9/egcs/gcc/cse.c	Thu Sep 20 18:33:14 2001
--- cse.c	Sat Sep 22 16:49:12 2001
*************** cse_insn (insn, libcall_insn)
*** 5763,5773 ****
        else if (n_sets == 1 && dest == pc_rtx && src == pc_rtx)
  	{
  	  /* One less use of the label this insn used to jump to.  */
! 	  if (JUMP_LABEL (insn) != 0)
! 	    --LABEL_NUSES (JUMP_LABEL (insn));
! 	  PUT_CODE (insn, NOTE);
! 	  NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
! 	  NOTE_SOURCE_FILE (insn) = 0;
  	  cse_jumps_altered = 1;
  	  /* No more processing for this set.  */
  	  sets[i].rtl = 0;
--- 5763,5769 ----
        else if (n_sets == 1 && dest == pc_rtx && src == pc_rtx)
  	{
  	  /* One less use of the label this insn used to jump to.  */
! 	  delete_insn (insn);
  	  cse_jumps_altered = 1;
  	  /* No more processing for this set.  */
  	  sets[i].rtl = 0;
*************** cse_insn (insn, libcall_insn)
*** 6310,6320 ****
        && (tem = single_set (prev_insn)) != 0
        && SET_DEST (tem) == cc0_rtx
        && ! reg_mentioned_p (cc0_rtx, x))
!     {
!       PUT_CODE (prev_insn, NOTE);
!       NOTE_LINE_NUMBER (prev_insn) = NOTE_INSN_DELETED;
!       NOTE_SOURCE_FILE (prev_insn) = 0;
!     }
  
    prev_insn_cc0 = this_insn_cc0;
    prev_insn_cc0_mode = this_insn_cc0_mode;
--- 6306,6312 ----
        && (tem = single_set (prev_insn)) != 0
        && SET_DEST (tem) == cc0_rtx
        && ! reg_mentioned_p (cc0_rtx, x))
!     delete-insn (prev_insn);
  
    prev_insn_cc0 = this_insn_cc0;
    prev_insn_cc0_mode = this_insn_cc0_mode;


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