c-typeck.c (c_finish_if_stmt): Use void_type_node as type for COND_EXPR.
authorRichard Guenther <rguenth@gcc.gnu.org>
Tue, 7 Jun 2005 10:10:22 +0000 (10:10 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 7 Jun 2005 10:10:22 +0000 (10:10 +0000)
2005-06-07  Richard Guenther  <rguenth@gcc.gnu.org>

* c-typeck.c (c_finish_if_stmt): Use void_type_node as type
for COND_EXPR.
* gimplify.c (gimplify_cond_expr): No need to fix up the
type of COND_EXPRs.

From-SVN: r100705

gcc/ChangeLog
gcc/c-typeck.c
gcc/gimplify.c

index 6deb5e0779c034705cd8dc07aa37422b3975623c..5fc0d27b3e7240d08c4a3cfa2c7365591d4ea890 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-07  Richard Guenther  <rguenth@gcc.gnu.org>
+
+       * c-typeck.c (c_finish_if_stmt): Use void_type_node as type
+       for COND_EXPR.
+       * gimplify.c (gimplify_cond_expr): No need to fix up the
+       type of COND_EXPRs.
+
 2005-06-07  Richard Guenther  <rguenth@gcc.gnu.org>
 
        * tree-ssa.c (tree_ssa_useless_type_conversion_1): Fix
index 25a280a6d54efd8f8d9a15a170b3cb14773409ce..a1c7e56f76bb33404ea66c3ceace54bab1f9a668 100644 (file)
@@ -6931,7 +6931,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
        }
     }
 
-  stmt = build3 (COND_EXPR, NULL_TREE, cond, then_block, else_block);
+  stmt = build3 (COND_EXPR, void_type_node, cond, then_block, else_block);
   SET_EXPR_LOCATION (stmt, if_locus);
   add_stmt (stmt);
 }
index 6834e1a3c5f6856c71d06d60810077bc46758463..bcc9ba262f9256cd60b3b3a22fd89a3a41d12d86 100644 (file)
@@ -2124,12 +2124,10 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, tree *post_p, tree target,
   enum gimplify_status ret;
 
   type = TREE_TYPE (expr);
-  if (!type)
-    TREE_TYPE (expr) = void_type_node;
 
   /* If this COND_EXPR has a value, copy the values into a temporary within
      the arms.  */
-  else if (! VOID_TYPE_P (type))
+  if (! VOID_TYPE_P (type))
     {
       tree result;