problem in jump.c

Herman ten Brugge Haj.Ten.Brugge@net.HCC.nl
Tue Dec 1 08:46:00 GMT 1998


Hello,

I discovered another problem in jump.c. I did sent this patch before
on Nov 11. The patch that was made on Sep 2 contained two problems. The first
one is fixed now by Richard Henderson. The second problem remains.
The second problem is that the routine regs_set_between_p will only check
insn from a start insn to an end insn. The start and end are not included in
this check. This means that the call:

regs_set_between_p (PATTERN (temp), temp2, NEXT_INSN (temp2))

will allways return true. I corrected this with patch below.

Tue Dec  1 17:38:46 1998 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>

	* jump.c (jump_optimize): Correct Sep 2 change. Call modified_between_p
	with PREV_INSN(x), NEXT_INSN(x) to check insn x.

--- jump.c.org	Mon Nov 30 20:19:59 1998
+++ jump.c	Mon Nov 30 20:20:54 1998
@@ -521,7 +521,8 @@ jump_optimize (f, cross_jump, noop_moves
 		      || ! modified_between_p (SET_SRC (temp4), p, temp2))
 		  /* Verify that registers used by the jump are not clobbered
 		     by the instruction being moved.  */
-		  && ! regs_set_between_p (PATTERN (temp), temp2,
+		  && ! regs_set_between_p (PATTERN (temp),
+					   PREV_INSN (temp2),
 					   NEXT_INSN (temp2)))
 		{
 		  emit_insn_after_with_line_notes (PATTERN (temp2), p, temp2);
@@ -622,7 +623,8 @@ jump_optimize (f, cross_jump, noop_moves
 		  && ! modified_between_p (SET_SRC (temp4), insert_after, temp)
 		  /* Verify that registers used by the jump are not clobbered
 		     by the instruction being moved.  */
-		  && ! regs_set_between_p (PATTERN (temp), temp3,
+		  && ! regs_set_between_p (PATTERN (temp),
+					   PREV_INSN (temp3),
 					   NEXT_INSN (temp3))
 		  && invert_jump (temp, JUMP_LABEL (insn)))
 		{

-- 
-------------------------------------------------------------------------
Herman ten Brugge			Email:	Haj.Ten.Brugge@net.HCC.nl



More information about the Gcc-patches mailing list