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
This commit is contained in:
parent
986dc4e5c4
commit
b1500d001a
2 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue