(build_conditional_expr): Always convert and check

both result operands even if condition is constant.

From-SVN: r3415
This commit is contained in:
Richard Stallman 1993-02-02 23:37:23 +00:00
parent e681c5a107
commit 5abb45f22e
1 changed files with 3 additions and 3 deletions

View File

@ -3584,9 +3584,6 @@ build_conditional_expr (ifexp, op1, op2)
= build_type_variant (result_type,
TREE_READONLY (op1) || TREE_READONLY (op2),
TREE_THIS_VOLATILE (op1) || TREE_THIS_VOLATILE (op2));
if (TREE_CODE (ifexp) == INTEGER_CST)
return convert_and_check (result_type, integer_zerop (ifexp) ? op2 : op1);
if (result_type != TREE_TYPE (op1))
op1 = convert_and_check (result_type, op1);
@ -3629,6 +3626,9 @@ build_conditional_expr (ifexp, op1, op2)
}
}
#endif /* 0 */
if (TREE_CODE (ifexp) == INTEGER_CST)
return integer_zerop (ifexp) ? op2 : op1;
return fold (build (COND_EXPR, result_type, ifexp, op1, op2));
}