fold-const.c (range_predecessor): Use operand_equal_p as the predicate for equality.
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 23 Apr 2006 09:06:32 +0000 (09:06 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 23 Apr 2006 09:06:32 +0000 (09:06 +0000)
* fold-const.c (range_predecessor): Use operand_equal_p
as the predicate for equality.
(range_successor): Likewise.

From-SVN: r113192

gcc/ChangeLog
gcc/fold-const.c

index 0b2febd597e5e43f14d4566a3d63c64d34f53a58..76914efa78bb49be3cc5f4a046b32797c5a773ee 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-23  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * fold-const.c (range_predecessor): Use operand_equal_p
+       as the predicate for equality.
+       (range_successor): Likewise.
+
 2006-04-22  Kazu Hirata  <kazu@codesourcery.com>
 
        Revert:
index 39bd36689d5bab60a9d45d2e4bd0dc5cd445c18a..567168276e19762e41ff781985da1873cb3ae6be 100644 (file)
@@ -4158,7 +4158,8 @@ range_predecessor (tree val)
 {
   tree type = TREE_TYPE (val);
 
-  if (INTEGRAL_TYPE_P (type) && val == TYPE_MIN_VALUE (type))
+  if (INTEGRAL_TYPE_P (type)
+      && operand_equal_p (val, TYPE_MIN_VALUE (type), 0))
     return 0;
   else
     return range_binop (MINUS_EXPR, NULL_TREE, val, 0, integer_one_node, 0);
@@ -4171,7 +4172,8 @@ range_successor (tree val)
 {
   tree type = TREE_TYPE (val);
 
-  if (INTEGRAL_TYPE_P (type) && val == TYPE_MAX_VALUE (type))
+  if (INTEGRAL_TYPE_P (type)
+      && operand_equal_p (val, TYPE_MAX_VALUE (type), 0))
     return 0;
   else
     return range_binop (PLUS_EXPR, NULL_TREE, val, 0, integer_one_node, 0);