* fold-const.c (tree_expr_nonnegative_p): Regroup cases.

From-SVN: r103178
This commit is contained in:
Volker Reichelt 2005-08-16 22:13:37 +00:00 committed by Volker Reichelt
parent cf0efa6a76
commit 196f5a8dcd
2 changed files with 24 additions and 31 deletions

View File

@ -1,3 +1,7 @@
2005-08-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* fold-const.c (tree_expr_nonnegative_p): Regroup cases.
2005-08-16 Ian Lance Taylor <ian@airs.com>
PR c++/23337

View File

@ -10782,6 +10782,15 @@ tree_expr_nonnegative_p (tree t)
}
return 0;
case BIT_AND_EXPR:
case MAX_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
|| tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case MIN_EXPR:
case RDIV_EXPR:
case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR:
case FLOOR_DIV_EXPR:
@ -10793,19 +10802,21 @@ tree_expr_nonnegative_p (tree t)
case CEIL_MOD_EXPR:
case FLOOR_MOD_EXPR:
case ROUND_MOD_EXPR:
case SAVE_EXPR:
case NON_LVALUE_EXPR:
case FLOAT_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case RDIV_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case COMPOUND_EXPR:
case MODIFY_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case BIT_AND_EXPR:
case BIND_EXPR:
return tree_expr_nonnegative_p (expr_last (TREE_OPERAND (t, 1)));
case COND_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1))
|| tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 2));
case NOP_EXPR:
{
@ -10834,28 +10845,6 @@ tree_expr_nonnegative_p (tree t)
}
break;
case COND_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 2));
case COMPOUND_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case MIN_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case MAX_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
|| tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case MODIFY_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
case BIND_EXPR:
return tree_expr_nonnegative_p (expr_last (TREE_OPERAND (t, 1)));
case SAVE_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case NON_LVALUE_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case FLOAT_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case TARGET_EXPR:
{
tree temp = TARGET_EXPR_SLOT (t);