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]

Commited unroll patch


Hi!

I have commited following patch to fix gcc.c-torture/execute/20000819-1.c
testcase (in addition to removing that test's XFAIL).
The issue is that we need to ensure in loop_find_equiv_value that the
equivalent value does not change between the point it is assigned to the
register we're looking for and loop start. In the testcase this value was
modified in between, so loop thought there is just one iteration.
This patch has been reviewed by Geoff Keating, bootstrapped on i386 and did
not produce any regressions.

2000-08-21  Jakub Jelinek  <jakub@redhat.com>

	* unroll.c (loop_find_equiv_value): If ret is modified between
	insn and loop_start, ret might not be equivalent to reg.

--- gcc/unroll.c.jj	Fri Aug 18 23:44:09 2000
+++ gcc/unroll.c	Mon Aug 21 17:28:09 2000
@@ -3550,6 +3550,11 @@ loop_find_equiv_value (loop, reg)
 		ret = XEXP (note, 0);
 	      else
 		ret = SET_SRC (set);
+
+	      /* We cannot do this if it changes between the
+		 assignment and loop start though.  */
+	      if (modified_between_p (ret, insn, loop_start))
+		ret = reg;
 	    }
 	  break;
 	}

	Jakub

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