Giv combination problem

Bernd Schmidt crux@Pool.Informatik.RWTH-Aachen.DE
Mon Oct 5 00:53:00 GMT 1998


Yesterday, I ran across a piece of code for which loop failed to combine
five identical givs.  I believe the problem is in combine_givs_p, where
the return value of express_from is compared to the wrong value.  If the
givs are identical, express_from should return g1->dest_reg, not const0_rtx.

	* loop.c (combine_givs_p): Fix test for identical givs.

Index: loop.c
===================================================================
RCS file: /usr/local/cvs/gcs/gcc/loop.c,v
retrieving revision 1.1.1.41
diff -u -p -r1.1.1.41 loop.c
--- loop.c	1998/10/01 14:39:32	1.1.1.41
+++ loop.c	1998/10/03 09:13:17
@@ -6313,7 +6313,7 @@ combine_givs_p (g1, g2)
   /* If these givs are identical, they can be combined.  We use the results
      of express_from because the addends are not in a canonical form, so
      rtx_equal_p is a weaker test.  */
-  if (tem == const0_rtx)
+  if (tem == g1->dest_reg)
     {
       return g1->dest_reg;
     }



More information about the Gcc-patches mailing list