diff options
author | Richard Henderson <rth@redhat.com> | 2004-06-21 02:15:29 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-06-21 02:15:29 -0700 |
commit | 3a5b9284da6acc309118a04dcba3a1cbca2ecdd4 (patch) | |
tree | 2f19dd655a5b6d52dc032012f1972b9a63e632e4 /gcc/c-common.c | |
parent | 2c486ea78cfcbd4b05c7845db23647fe2bf61d6d (diff) | |
download | gcc-3a5b9284da6acc309118a04dcba3a1cbca2ecdd4.zip gcc-3a5b9284da6acc309118a04dcba3a1cbca2ecdd4.tar.gz gcc-3a5b9284da6acc309118a04dcba3a1cbca2ecdd4.tar.bz2 |
c-common.c (verify_sequence_points): Export.
* c-common.c (verify_sequence_points): Export.
(c_expand_expr_stmt): Move to c-typeck.c.
* c-common.h (c_expand_expr_stmt): Remove.
(verify_sequence_points): Declare.
* c-mudflap.c (mflang_flush_calls): Use c_finish_expr_stmt.
* c-parse.in (for_init_stmt, stmt): Likewise.
* c-tree.h (c_finish_expr_stmt): Declare.
(c_tree_expr_nonnegative_p): Remove.
* c-typeck.c (c_tree_expr_nonnegative_p): Remove.
(build_conditional_expr, build_binary_op): Use tree_expr_nonnegative_p.
(emit_side_effect_warnings): New.
(c_finish_expr_stmt): Rename from c_expand_expr_stmt. Use it.
(c_finish_stmt_expr): Work without EXPR_STMT. Handle eh regions.
Use emit_side_effect_warnings.
(push_cleanup): Copy STATEMENT_LIST_STMT_EXPR.
* fold-const.c (tree_expr_nonnegative_p): Handle TARGET_EXPR.
* gimplify.c (gimplify_modify_expr): Don't discard TARGET_EXPR
with void initializer.
(gimplify_target_expr): Handle void BIND_EXPR initializer.
* tree-inline.c (estimate_num_insns_1): Fix type lookup for
INIT_EXPR and MODIFY_EXPR.
* objc/objc-act.c (build_module_descriptor): Use add_stmt
instead of c_expand_expr_stmt.
cp/
* semantics.c (finish_expr_stmt): Call verify_sequence_points.
testsuite/
* gcc.dg/tree-ssa/20030714-1.c: Rename variables to avoid
merging && to BIT_FIELD_REF.
From-SVN: r83429
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index a982852..79d9d9a 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1247,7 +1247,6 @@ static int warning_candidate_p (tree); static void warn_for_collisions (struct tlist *); static void warn_for_collisions_1 (tree, tree, struct tlist *, int); static struct tlist *new_tlist (struct tlist *, tree, tree); -static void verify_sequence_points (tree); /* Create a new struct tlist and fill in its fields. */ static struct tlist * @@ -1586,7 +1585,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, /* Try to warn for undefined behavior in EXPR due to missing sequence points. */ -static void +void verify_sequence_points (tree expr) { struct tlist *before_sp = 0, *after_sp = 0; @@ -1603,32 +1602,6 @@ verify_sequence_points (tree expr) warn_for_collisions (after_sp); obstack_free (&tlist_obstack, tlist_firstobj); } - -tree -c_expand_expr_stmt (tree expr) -{ - /* Do default conversion if safe and possibly important, - in case within ({...}). */ - if ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE - && (flag_isoc99 || lvalue_p (expr))) - || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE) - expr = default_conversion (expr); - - if (warn_sequence_point) - verify_sequence_points (expr); - - if (TREE_TYPE (expr) != error_mark_node - && !COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (expr)) - && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) - error ("expression statement has incomplete type"); - - /* As tempting as it might be, we can't diagnose statement with no - effect yet. We have to wait until after statement expressions - have been parsed, and that process modifies the trees we are - creating here. */ - - return add_stmt (build_stmt (EXPR_STMT, expr)); -} /* Validate the expression after `case' and apply default promotions. */ |