aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Schmidt <crux@pool.informatik.rwth-aachen.de>1998-10-22 15:48:47 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-22 09:48:47 -0600
commit86219cc76f52066bc849b7693fe0bc5ebf41503d (patch)
tree270ce0b12b84ef428fc1dfd6d44bd996d1165aad /gcc
parentdb1b5e8135ad094bb6a8a7f78d857272603dec49 (diff)
downloadgcc-86219cc76f52066bc849b7693fe0bc5ebf41503d.zip
gcc-86219cc76f52066bc849b7693fe0bc5ebf41503d.tar.gz
gcc-86219cc76f52066bc849b7693fe0bc5ebf41503d.tar.bz2
loop.c (express_from): Make sure that when generating a PLUS of a PLUS...
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/loop.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6be33b..f1e6985 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/loop.c b/gcc/loop.c
index 5db0a9c..c8b0954 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -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);
+ }
+
}
/* Return an rtx, if any, that expresses giv G2 as a function of the register