diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cef71f44ea7bbe0f4683a0cceba18a0286c5b550..891b4968de4f9598c646854bc76a8ca12ccaf0bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
 Fri Dec 17 01:32:38 MET 1999  Jan Hubicka  <hubicka@freesoft.cz>
 
+	* regmove.c (copy_src_to_dest): Remove loop_depth parameter.
+	(optimize_reg_copy_1): Remove REG_N_REFS updating code.
+	(optimize_reg_copy_2, copy_src_to_dest, fixup_match_2): Likewise.
+	(regmove_optimize, fixup_match_1): Likewise.
+
 	* i386.md (HI to SImode promoting splitters): Rewrite.
 	(pushsf mem peep2): New.
 	(testhi to andhi peep2): Remove.
diff --git a/gcc/regmove.c b/gcc/regmove.c
index b78ea1614614710d95cd34f642c971b5fd00b02b..8b2bc0b57c1bb3088efab1963cf9098ede5a355f 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -403,10 +403,7 @@ optimize_reg_copy_1 (insn, dest, src)
 
   for (p = NEXT_INSN (insn); p; p = NEXT_INSN (p))
     {
-      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
-	  || (GET_CODE (p) == NOTE
-	      && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-		  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN)
 	break;
 
       /* ??? We can't scan past the end of a basic block without updating
@@ -591,10 +588,7 @@ optimize_reg_copy_2 (insn, dest, src)
 
   for (p = NEXT_INSN (insn); p; p = NEXT_INSN (p))
     {
-      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
-	  || (GET_CODE (p) == NOTE
-	      && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-		  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN)
 	break;
 
       /* ??? We can't scan past the end of a basic block without updating
@@ -668,10 +662,7 @@ optimize_reg_copy_3 (insn, dest, src)
     return;
   for (p = PREV_INSN (insn); p && ! reg_set_p (src_reg, p); p = PREV_INSN (p))
     {
-      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
-	  || (GET_CODE (p) == NOTE
-	      && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-		  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN)
 	return;
 
       /* ??? We can't scan past the end of a basic block without updating
@@ -949,10 +940,7 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
       rtx pset;
 
       if (GET_CODE (p) == CODE_LABEL
-          || GET_CODE (p) == JUMP_INSN
-          || (GET_CODE (p) == NOTE
-              && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-                  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+          || GET_CODE (p) == JUMP_INSN)
         break;
 
       /* ??? We can't scan past the end of a basic block without updating
@@ -1000,10 +988,7 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
 	      for (p = PREV_INSN (insn); p; p = PREV_INSN (p))
 		{
 		  if (GET_CODE (p) == CODE_LABEL
-		      || GET_CODE (p) == JUMP_INSN
-		      || (GET_CODE (p) == NOTE
-			  && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-			      || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+		      || GET_CODE (p) == JUMP_INSN)
 		    break;
 		  if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
 		    continue;
@@ -1017,10 +1002,7 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
 	      for (p = NEXT_INSN (insn); p; p = NEXT_INSN (p))
 		{
 		  if (GET_CODE (p) == CODE_LABEL
-		      || GET_CODE (p) == JUMP_INSN
-		      || (GET_CODE (p) == NOTE
-			  && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-			      || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+		      || GET_CODE (p) == JUMP_INSN)
 		    break;
 		  if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
 		    continue;
@@ -1388,10 +1370,7 @@ regmove_optimize (f, nregs, regmove_dump_file)
 		  rtx pset;
 
 		  if (GET_CODE (p) == CODE_LABEL
-		      || GET_CODE (p) == JUMP_INSN
-		      || (GET_CODE (p) == NOTE
-			  && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-			      || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+		      || GET_CODE (p) == JUMP_INSN)
 		    break;
 
 		  /* ??? We can't scan past the end of a basic block without
@@ -1678,10 +1657,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
 
   for (length = s_length = 0, p = NEXT_INSN (insn); p; p = NEXT_INSN (p))
     {
-      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
-	  || (GET_CODE (p) == NOTE
-	      && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
-		  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN)
 	break;
 
       /* ??? We can't scan past the end of a basic block without updating
@@ -1727,10 +1703,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
 		break;
 	      for (q = p; q; q = NEXT_INSN (q))
 		{
-		  if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN
-		      || (GET_CODE (q) == NOTE
-			  && (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
-			      || NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
+		  if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN)
 		    {
 		      q = 0;
 		      break;
@@ -1906,10 +1879,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
 	{
 	  for (q = PREV_INSN (insn); q; q = PREV_INSN(q))
 	    {
-	      if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN
-		  || (GET_CODE (q) == NOTE
-		      && (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
-			  || NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
+	      if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN)
 		{
 		  q = 0;
 		  break;
@@ -1981,10 +1951,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
       inc_dest = post_inc_set ? SET_DEST (post_inc_set) : src;
       for (q = post_inc; (q = NEXT_INSN (q)); )
 	{
-	  if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN
-	      || (GET_CODE (q) == NOTE
-		  && (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
-		      || NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
+	  if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN)
 	    break;
 
 	  /* ??? We can't scan past the end of a basic block without updating