(build_conditional_expr): Always convert and check
authorRichard Stallman <rms@gnu.org>
Tue, 2 Feb 1993 23:37:23 +0000 (23:37 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 2 Feb 1993 23:37:23 +0000 (23:37 +0000)
both result operands even if condition is constant.

From-SVN: r3415

gcc/c-typeck.c

index 649467af9f5b6617fac9c5cb919e8db947612e46..3cb6959e8764641c5e7897cf58679bb7afea7af3 100644 (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));
 }