From fff34d356a721134207d6545fc134a412af8f885 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 25 Jun 2004 03:46:30 +0000 Subject: [PATCH] c-gimplify.c (gimplify_for_stmt): Use gimplify_and_add. * c-gimplify.c (gimplify_for_stmt): Use gimplify_and_add. * gimplify.c (internal_get_tmp_var, gimplify_return_expr): Likewise. (gimplify_loop_expr, gimplify_init_constructor): Likewise. (gimplify_self_mod_expr, gimplify_cond_expr): Likewise. From-SVN: r83634 --- gcc/ChangeLog | 5 +++++ gcc/c-gimplify.c | 6 ++---- gcc/gimplify.c | 22 +++++++++------------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d02cd056827..2b706092238 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2004-06-24 Richard Kenner + * c-gimplify.c (gimplify_for_stmt): Use gimplify_and_add. + * gimplify.c (internal_get_tmp_var, gimplify_return_expr): Likewise. + (gimplify_loop_expr, gimplify_init_constructor): Likewise. + (gimplify_self_mod_expr, gimplify_cond_expr): Likewise. + PR/16131 * gimplify.c (voidify_wrapper_expr): Allow TARGET_EXPR. diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c index 44af046d1ee..811365e2746 100644 --- a/gcc/c-gimplify.c +++ b/gcc/c-gimplify.c @@ -411,10 +411,8 @@ gimplify_for_stmt (tree *stmt_p, tree *pre_p) tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) - { - gimplify_stmt (&FOR_INIT_STMT (stmt)); - append_to_statement_list (FOR_INIT_STMT (stmt), pre_p); - } + gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); + *stmt_p = gimplify_c_loop (FOR_COND (stmt), FOR_BODY (stmt), FOR_EXPR (stmt), 1); diff --git a/gcc/gimplify.c b/gcc/gimplify.c index b482fface7d..a7960fde376 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -456,10 +456,9 @@ internal_get_tmp_var (tree val, tree *pre_p, tree *post_p, bool is_formal) SET_EXPR_LOCUS (mod, EXPR_LOCUS (val)); else annotate_with_locus (mod, input_location); - /* gimplify_modify_expr might want to reduce this further. */ - gimplify_stmt (&mod); - append_to_statement_list (mod, pre_p); + /* gimplify_modify_expr might want to reduce this further. */ + gimplify_and_add (mod, pre_p); return t; } @@ -990,8 +989,8 @@ gimplify_return_expr (tree stmt, tree *pre_p) Then gimplify the whole thing. */ if (result != result_decl) TREE_OPERAND (ret_expr, 0) = result; - gimplify_stmt (&TREE_OPERAND (stmt, 0)); - append_to_statement_list (TREE_OPERAND (stmt, 0), pre_p); + + gimplify_and_add (TREE_OPERAND (stmt, 0), pre_p); /* If we didn't use a temporary, then the result is just the result_decl. Otherwise we need a simple copy. This should already be gimple. */ @@ -1019,8 +1018,7 @@ gimplify_loop_expr (tree *expr_p, tree *pre_p) gimplify_ctxp->exit_label = NULL_TREE; - gimplify_stmt (&LOOP_EXPR_BODY (*expr_p)); - append_to_statement_list (LOOP_EXPR_BODY (*expr_p), pre_p); + gimplify_and_add (LOOP_EXPR_BODY (*expr_p), pre_p); if (gimplify_ctxp->exit_label) { @@ -1447,9 +1445,9 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, purpose, NULL_TREE); init = build (MODIFY_EXPR, TREE_TYPE (purpose), cref, value); + /* Each member initialization is a full-expression. */ - gimplify_stmt (&init); - append_to_statement_list (init, pre_p); + gimplify_and_add (init, pre_p); } *expr_p = NULL_TREE; @@ -2022,8 +2020,7 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p, if (postfix) { - gimplify_stmt (&t1); - append_to_statement_list (t1, post_p); + gimplify_and_add (t1, post_p); *expr_p = lhs; return GS_ALL_DONE; } @@ -2475,8 +2472,7 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, tree target) recalculate_side_effects (expr); /* Move the COND_EXPR to the prequeue and use the temp in its place. */ - gimplify_stmt (&expr); - append_to_statement_list (expr, pre_p); + gimplify_and_add (expr, pre_p); *expr_p = tmp; return ret; -- 2.30.2