]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop.c (express_from): Make sure that when generating a PLUS of a PLUS...
authorBernd Schmidt <crux@pool.informatik.rwth-aachen.de>
Thu, 22 Oct 1998 15:48:47 +0000 (15:48 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 22 Oct 1998 15:48:47 +0000 (09:48 -0600)
        * loop.c (express_from): Make sure that when generating a PLUS of
        a PLUS, any constant expression appears on the outermost PLUS.

From-SVN: r23226

gcc/ChangeLog
gcc/loop.c

index d6be33b53263197de2554e8135de71ce32327dcb..f1e69851af9126b1d7ed8631922489b312a9ea3d 100644 (file)
@@ -1,3 +1,8 @@
+Thu Oct 22 16:46:35 1998  Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
+
+       * loop.c (express_from): Make sure that when generating a PLUS of
+       a PLUS, any constant expression appears on the outermost PLUS.
+
 Thu Oct 22 15:46:23 1998  Per Bothner (bothner@cygnus.com)
 
        * Makefile.in (distdir-cvs, distdir-start):  Clean up so it
index 5db0a9c11ece673a48bbb24fba2fb355c04d4f2f..c8b0954e2271f1837663119e119cbc82e2803591 100644 (file)
@@ -6221,7 +6221,18 @@ express_from (g1, g2)
   if (add == const0_rtx)
     return mult;
   else
-    return gen_rtx_PLUS (g2->mode, mult, add);
+    {
+      if (GET_CODE (add) == PLUS
+         && CONSTANT_P (XEXP (add, 1)))
+       {
+         rtx tem = XEXP (add, 1);
+         mult = gen_rtx_PLUS (g2->mode, mult, XEXP (add, 0));
+         add = tem;
+       }
+      
+      return gen_rtx_PLUS (g2->mode, mult, add);
+    }
+  
 }
 \f
 /* Return an rtx, if any, that expresses giv G2 as a function of the register