+2004-01-23 Eric Botcazou <ebotcazou@act-europe.fr>
+ Olivier Hainque <hainque@act-europe.fr>
+
+ * fold-const.c (fold_binary_op_with_conditional_arg): Only
+ build a COMPOUND_EXPR if 'arg' is really a SAVE_EXPR.
+
2004-01-23 Daniel Jacobowitz <drow@mvista.com>
* config/arm/arm.c (arm_legitimate_address_p): Don't check the mode
{
arg = save_expr (arg);
lhs = rhs = 0;
- save = 1;
+ save = saved_expr_p (arg);
}
}
test = fold (build (COND_EXPR, type, test, lhs, rhs));
+ /* If ARG involves a SAVE_EXPR, we need to ensure it is evaluated
+ ahead of the COND_EXPR we made. Otherwise we would have it only
+ evaluated in one branch, with the other branch using the result
+ but missing the evaluation code. Beware that the save_expr call
+ above might not return a SAVE_EXPR, so testing the TREE_CODE
+ of ARG is not enough to decide here. */
if (save)
return build (COMPOUND_EXPR, type,
convert (void_type_node, arg),