Use single_set in loop.c

Geoff Keating geoffk@geoffk.org
Tue Jul 31 11:22:00 GMT 2001


I have a port that wants a temporary for branches, which means a
CLOBBER, which means the insn isn't always a straight SET.

Tested on powerpc-eabisim.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

===File ~/patches/cygnus/gcc-loopsingleset.patch============
2001-07-30  Geoffrey Keating  <geoffk@redhat.com>

	* loop.c (check_dbra_loop): Use single_set to compute
	jump_label.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.340
diff -p -u -p -r1.340 loop.c
--- loop.c	2001/07/25 22:36:42	1.340
+++ loop.c	2001/07/30 23:12:44
@@ -7559,9 +7559,11 @@ check_dbra_loop (loop, insn_count)
 
 	      /* Save some info needed to produce the new insns.  */
 	      reg = bl->biv->dest_reg;
-	      jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 1);
+	      jump_label = XEXP (SET_SRC (single_set (PREV_INSN (loop_end))), 
+				 1);
 	      if (jump_label == pc_rtx)
-		jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 2);
+		jump_label = XEXP (SET_SRC (single_set (PREV_INSN (loop_end))),
+				   2);
 	      new_add_val = GEN_INT (-INTVAL (bl->biv->add_val));
 
 	      /* Set start_value; if this is not a CONST_INT, we need
============================================================



More information about the Gcc-patches mailing list