diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-26 18:10:53 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-26 18:10:53 +0000 |
commit | da73cc7515b9565c5e72ae0d96c1b97d309e375e (patch) | |
tree | 0f1b677728d44296d9537a0c12aa3f3f1615257d /gcc/cp/cp-gimplify.c | |
parent | 9190fc401916e23ff3f929046d93d907d411f469 (diff) | |
download | gcc-da73cc7515b9565c5e72ae0d96c1b97d309e375e.tar.gz |
* tree.c (build_vec_init_expr): Split out from...
(build_array_copy): ...here.
* init.c (perform_member_init): Use it.
* cp-tree.h: Declare it.
* cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
(cp_gimplify_expr): Handle array default-initialization via
VEC_INIT_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165976 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r-- | gcc/cp/cp-gimplify.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index e5a7f265958..dd879c63b15 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -424,7 +424,7 @@ gimplify_expr_stmt (tree *stmt_p) /* Gimplify initialization from an AGGR_INIT_EXPR. */ static void -cp_gimplify_init_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) +cp_gimplify_init_expr (tree *expr_p) { tree from = TREE_OPERAND (*expr_p, 1); tree to = TREE_OPERAND (*expr_p, 0); @@ -451,7 +451,6 @@ cp_gimplify_init_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) if (TREE_CODE (sub) == AGGR_INIT_EXPR || TREE_CODE (sub) == VEC_INIT_EXPR) { - gimplify_expr (&to, pre_p, post_p, is_gimple_lvalue, fb_lvalue); if (TREE_CODE (sub) == AGGR_INIT_EXPR) AGGR_INIT_EXPR_SLOT (sub) = to; else @@ -531,10 +530,13 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) case VEC_INIT_EXPR: { location_t loc = input_location; + tree init = VEC_INIT_EXPR_INIT (*expr_p); + int from_array = (init && TREE_CODE (TREE_TYPE (init)) == ARRAY_TYPE); gcc_assert (EXPR_HAS_LOCATION (*expr_p)); input_location = EXPR_LOCATION (*expr_p); *expr_p = build_vec_init (VEC_INIT_EXPR_SLOT (*expr_p), NULL_TREE, - VEC_INIT_EXPR_INIT (*expr_p), false, 1, + init, /*explicit_value_init_p*/false, + from_array, tf_warning_or_error); ret = GS_OK; input_location = loc; @@ -556,7 +558,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) LHS of an assignment might also be involved in the RHS, as in bug 25979. */ case INIT_EXPR: - cp_gimplify_init_expr (expr_p, pre_p, post_p); + cp_gimplify_init_expr (expr_p); if (TREE_CODE (*expr_p) != INIT_EXPR) return GS_OK; /* Otherwise fall through. */ |