Subject: Re: tools build on ELF mac68k
To: Matthew Fredette <fredette@MIT.EDU>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-toolchain
Date: 12/06/2001 09:42:20
On Thu, Dec 06, 2001 at 11:45:20AM -0500, Matthew Fredette wrote:

 > I think what needs to happen is that strength_reduce needs to call
 > a version of reg_used_between_p that knows about "loop insn order".

I think this has been fixed in gcc-3.0.  Looking at an old'ish
gcc-current tree I have, I see the following:

Tue Sep 14 01:33:15 1999  Andreas Schwab  <schwab@suse.de>

        * loop.c (strength_reduce): Don't call reg_used_between_p if the
        insn from BL2 is after the insn from BL.

The change was committed by Jeff Law in rev 1.186 of that file.  The
change is included below.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -r1.185 -r1.186
--- gcc/gcc/loop.c	1999/09/14 07:18:02	1.185
+++ gcc/gcc/loop.c	1999/09/14 07:34:59	1.186
@@ -4056,11 +4056,11 @@
 	         in-between when biv_total_increment returns nonzero both times
 		 but we test it here in case some day some real cfg analysis
 		 gets used to set always_computable.  */
-	      && ((loop_insn_first_p (bl2->biv->insn, bl->biv->insn)
-		   && no_labels_between_p (bl2->biv->insn, bl->biv->insn))
-		  || (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn,
-					    bl2->biv->insn)
-		      && no_jumps_between_p (bl->biv->insn, bl2->biv->insn)))
+	      && (loop_insn_first_p (bl2->biv->insn, bl->biv->insn)
+		  ? no_labels_between_p (bl2->biv->insn, bl->biv->insn)
+		  : (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn,
+					   bl2->biv->insn)
+		     && no_jumps_between_p (bl->biv->insn, bl2->biv->insn)))
 	      && validate_change (bl->biv->insn,
 				  &SET_SRC (single_set (bl->biv->insn)),
 				  copy_rtx (src), 0))