From b73a47045560ac7b2b808736383e8b5f8a97f55a Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 2 May 2011 18:00:07 -0400 Subject: revert: re PR c++/40975 (ICE in copy_tree_r on array new) Revert: PR c++/40975 * cp-tree.def (VEC_INIT_EXPR): Add third operand. * cp-tree.h (VEC_INIT_EXPR_NELTS): New. * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it. * tree.c (build_vec_init_expr): Handle getting pointer/nelts. (build_vec_init_elt): Don't expect an array type. (build_array_copy): Adjust. * init.c (perform_member_init): Adjust. (build_new_1): Use build_vec_init_expr. From-SVN: r173274 --- gcc/cp/init.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'gcc/cp/init.c') diff --git a/gcc/cp/init.c b/gcc/cp/init.c index d8b19c7..50dbcc9 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -506,8 +506,7 @@ perform_member_init (tree member, tree init) /* mem() means value-initialization. */ if (TREE_CODE (type) == ARRAY_TYPE) { - init = build_vec_init_expr (type, init, NULL_TREE, - tf_warning_or_error); + init = build_vec_init_expr (type, init); init = build2 (INIT_EXPR, type, decl, init); finish_expr_stmt (init); } @@ -544,8 +543,7 @@ perform_member_init (tree member, tree init) || same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (init))) { - init = build_vec_init_expr (type, init, NULL_TREE, - tf_warning_or_error); + init = build_vec_init_expr (type, init); init = build2 (INIT_EXPR, type, decl, init); finish_expr_stmt (init); } @@ -2388,14 +2386,15 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts, vecinit = build_tree_list_vec (*init); } init_expr - = build_vec_init_expr (data_addr, - (explicit_value_init_p - ? void_type_node: vecinit), - cp_build_binary_op (input_location, - MINUS_EXPR, outer_nelts, - integer_one_node, - complain), - complain); + = build_vec_init (data_addr, + cp_build_binary_op (input_location, + MINUS_EXPR, outer_nelts, + integer_one_node, + complain), + vecinit, + explicit_value_init_p, + /*from_array=*/0, + complain); /* An array initialization is stable because the initialization of each element is a full-expression, so the temporaries don't -- cgit v1.1