Commit b1500d00 by Roger Sayle Committed by Roger Sayle

fold-const.c (tree_expr_nonnegative_p): A&B is nonnegative when A is nonnegative…

fold-const.c (tree_expr_nonnegative_p): A&B is nonnegative when A is nonnegative or B is nonnegative.


	* fold-const.c (tree_expr_nonnegative_p): A&B is nonnegative when
	A is nonnegative or B is nonnegative.  Similarly A|B is nonnegative
	when both A and B are nonnegative.
	(tree_expr_nonzero_p): A|B is nonzero when A is nonzero or B is
	nonzero.

From-SVN: r79870
parent 986dc4e5
2004-03-23 Roger Sayle <roger@eyesopen.com>
* fold-const.c (tree_expr_nonnegative_p): A&B is nonnegative when
A is nonnegative or B is nonnegative. Similarly A|B is nonnegative
when both A and B are nonnegative.
(tree_expr_nonzero_p): A|B is nonzero when A is nonzero or B is
nonzero.
2004-03-23 Kazu Hirata <kazu@cs.umass.edu>
* fold-const.c (fold): Remove cases for INTEGER_CST, REAL_CST,
......
......@@ -8717,6 +8717,13 @@ tree_expr_nonnegative_p (tree t)
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case BIT_AND_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1))
|| tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case BIT_IOR_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case NOP_EXPR:
{
tree inner_type = TREE_TYPE (TREE_OPERAND (t, 0));
......@@ -8955,6 +8962,10 @@ tree_expr_nonzero_p (tree t)
case NON_LVALUE_EXPR:
return tree_expr_nonzero_p (TREE_OPERAND (t, 0));
case BIT_IOR_EXPR:
return tree_expr_nonzero_p (TREE_OPERAND (t, 1))
|| tree_expr_nonzero_p (TREE_OPERAND (t, 0));
default:
break;
}
......
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