aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorToon Moene <toon@moene.indiv.nluug.nl>1997-10-26 18:05:24 +0100
committerJeff Law <law@gcc.gnu.org>1997-10-26 10:05:24 -0700
commit91585c63e4f946b21ec89f51bb8ec555444ddd1f (patch)
tree417017ecb7a6d73819a07a63f313f7219f676602 /gcc
parent6d6d0fa07e124c351a01f4cadcfc16ef215817ad (diff)
downloadgcc-91585c63e4f946b21ec89f51bb8ec555444ddd1f.zip
gcc-91585c63e4f946b21ec89f51bb8ec555444ddd1f.tar.gz
gcc-91585c63e4f946b21ec89f51bb8ec555444ddd1f.tar.bz2
fold-const (fold): Also simplify FLOOR_DIV_EXPR to EXACT_DIV_EXPR if...
* fold-const (fold): Also simplify FLOOR_DIV_EXPR to EXACT_DIV_EXPR if the dividend is a multiple of the divisor. From-SVN: r16181
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9ad14ce..9b397f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Sun Oct 26 10:06:11 1997 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * fold-const (fold): Also simplify FLOOR_DIV_EXPR to EXACT_DIV_EXPR
+ if the dividend is a multiple of the divisor.
+
Sun Oct 26 09:21:40 1997 Jeffrey A Law (law@cygnus.com)
* toplev.c (flag_rerun_loop_opt): New variable.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index def96bf..1e823fb 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4610,11 +4610,10 @@ fold (expr)
/* If arg0 is a multiple of arg1, then rewrite to the fastest div
operation, EXACT_DIV_EXPR.
- Note that only CEIL_DIV_EXPR is rewritten now, only because the
- others seem to be faster in some cases. This is probably just
- due to more work being done to optimize others in expmed.c than on
- EXACT_DIV_EXPR. */
- if (code == CEIL_DIV_EXPR
+ Note that only CEIL_DIV_EXPR and FLOOR_DIV_EXPR are rewritten now.
+ At one time others generated faster code, it's not clear if they do
+ after the last round to changes to the DIV code in expmed.c. */
+ if ((code == CEIL_DIV_EXPR || code == FLOOR_DIV_EXPR)
&& multiple_of_p (type, arg0, arg1))
return fold (build (EXACT_DIV_EXPR, type, arg0, arg1));