Commit 1464eeb8 by Eric Botcazou Committed by Eric Botcazou

fold-const.c (range_predecessor): Use operand_equal_p as the predicate for equality.

	* fold-const.c (range_predecessor): Use operand_equal_p
	as the predicate for equality.
	(range_successor): Likewise.

From-SVN: r113192
parent 54ffdb12
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:
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment