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]

Giv combination problem


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;
     }


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