From: Richard Stallman Date: Tue, 2 Feb 1993 23:37:23 +0000 (+0000) Subject: (build_conditional_expr): Always convert and check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5abb45f22e162d6cc77d4cbefdbde01e36517555;p=gcc.git (build_conditional_expr): Always convert and check both result operands even if condition is constant. From-SVN: r3415 --- diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 649467af9f5..3cb6959e876 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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)); }