diff options
author | Jason Merrill <jason@redhat.com> | 2011-04-27 21:53:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-04-27 21:53:34 -0400 |
commit | c12ff9d8f0f20cd2de63de6f14b9f0330e7ceb66 (patch) | |
tree | 7fc7f017ff214e07e3790efe9c01bfe2b4b52bdb /gcc/cp/cp-gimplify.c | |
parent | fbaf0d0c082815cf67d958b7c9f596b1f814eca0 (diff) | |
download | gcc-c12ff9d8f0f20cd2de63de6f14b9f0330e7ceb66.zip gcc-c12ff9d8f0f20cd2de63de6f14b9f0330e7ceb66.tar.gz gcc-c12ff9d8f0f20cd2de63de6f14b9f0330e7ceb66.tar.bz2 |
re PR c++/40975 (ICE in copy_tree_r on array new)
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: r173056
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r-- | gcc/cp/cp-gimplify.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index ca62df3..dc2e0fb 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -530,10 +530,12 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) { location_t loc = input_location; tree init = VEC_INIT_EXPR_INIT (*expr_p); - int from_array = (init && TREE_CODE (TREE_TYPE (init)) == ARRAY_TYPE); + int from_array = (init && TREE_TYPE (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, + *expr_p = build_vec_init (VEC_INIT_EXPR_SLOT (*expr_p), + VEC_INIT_EXPR_NELTS (*expr_p), init, VEC_INIT_EXPR_VALUE_INIT (*expr_p), from_array, tf_warning_or_error); |