diff options
author | Richard Guenther <rguenth@gcc.gnu.org> | 2005-06-07 10:10:22 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2005-06-07 10:10:22 +0000 |
commit | 2214de30422cc30ce6a88feefc97bc8329dd6c2c (patch) | |
tree | 6ebbf32b5f064f2beb8dedf553879d6e4cb9f803 /gcc | |
parent | e0004427824f78e9ab1ec2a1eb241ff49fb4f8a1 (diff) | |
download | gcc-2214de30422cc30ce6a88feefc97bc8329dd6c2c.zip gcc-2214de30422cc30ce6a88feefc97bc8329dd6c2c.tar.gz gcc-2214de30422cc30ce6a88feefc97bc8329dd6c2c.tar.bz2 |
c-typeck.c (c_finish_if_stmt): Use void_type_node as type for COND_EXPR.
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-typeck.c | 2 | ||||
-rw-r--r-- | gcc/gimplify.c | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6deb5e0..5fc0d27 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 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 comments. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 25a280a..a1c7e56 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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); } diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 6834e1a..bcc9ba2 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -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; |