* fold-const.c (fold): Reorder tests for conditional expressions.

From-SVN: r65590
This commit is contained in:
Olivier Hainque 2003-04-14 23:09:44 +02:00 committed by Richard Kenner
parent 9ceca3020a
commit cbcafd35b7
2 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,7 @@
2003-04-14 Olivier Hainque <hainque@act-europe.fr>
* fold-const.c (fold): Reorder tests for conditional expressions.
* expr.c (highest_pow2_factor): Return unsigned.
* expr.h (offset_address): Likewise.
* emit-rtl.c (offset_address): POW2 argument now unsigned.

View File

@ -5063,6 +5063,14 @@ fold (expr)
fold (build1 (code, type, integer_one_node)),
fold (build1 (code, type, integer_zero_node))));
}
else if (TREE_CODE_CLASS (code) == '<'
&& TREE_CODE (arg0) == COMPOUND_EXPR)
return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
fold (build (code, type, TREE_OPERAND (arg0, 1), arg1)));
else if (TREE_CODE_CLASS (code) == '<'
&& TREE_CODE (arg1) == COMPOUND_EXPR)
return build (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
fold (build (code, type, arg0, TREE_OPERAND (arg1, 1))));
else if (TREE_CODE_CLASS (code) == '2'
|| TREE_CODE_CLASS (code) == '<')
{
@ -5098,14 +5106,6 @@ fold (expr)
fold_binary_op_with_conditional_arg (code, type, arg0, arg1,
/*cond_first_p=*/1);
}
else if (TREE_CODE_CLASS (code) == '<'
&& TREE_CODE (arg0) == COMPOUND_EXPR)
return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
fold (build (code, type, TREE_OPERAND (arg0, 1), arg1)));
else if (TREE_CODE_CLASS (code) == '<'
&& TREE_CODE (arg1) == COMPOUND_EXPR)
return build (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
fold (build (code, type, arg0, TREE_OPERAND (arg1, 1))));
switch (code)
{