aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e26229f..3f57b96 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-09 Falk Hueffner <falk@debian.org>
+
+ * fold-const.c (fold): Also handle EXACT_DIV_EXPR when folding
+ X/C1 cmpop C2.
+
2005-01-09 David Edelsohn <edelsohn@gnu.org>
PR target/18720
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 21ee14c..7ccd3a8 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8965,7 +8965,8 @@ fold (tree expr)
/* We can fold X/C1 op C2 where C1 and C2 are integer constants
into a single range test. */
- if (TREE_CODE (arg0) == TRUNC_DIV_EXPR
+ if ((TREE_CODE (arg0) == TRUNC_DIV_EXPR
+ || TREE_CODE (arg0) == EXACT_DIV_EXPR)
&& TREE_CODE (arg1) == INTEGER_CST
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
&& !integer_zerop (TREE_OPERAND (arg0, 1))