From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 9741F385355A; Sat, 1 Oct 2022 04:15:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9741F385355A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664597738; bh=goxx3alHU/IYdj4v1oOpxvlgBud8J540E3qentpffbs=; h=From:To:Subject:Date:From; b=IsxxOYUDWNFqZ2BMV0ZBzXb9tAceXj36i8BYt29QiCNeRd3vWRGTNda57nvofpysp mh6JKG8YaXL93QmJ/N9RwZ1SHs9f9Xj6Xh+MbH1DepTW4enCd2MoP98AjzjVOQJc+K Tp0k/dq8o4QMtvUOtW1450DSNFz87vD58/Z7+uzw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3008] c++: cast split_nonconstant_init return val to void X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: aa360fbf68b11e54017e8fa5b1bdb87ce7c19188 X-Git-Newrev: f8cb417d6a4e2912d15a6d8bdffd1548cc649b49 Message-Id: <20221001041538.9741F385355A@sourceware.org> Date: Sat, 1 Oct 2022 04:15:38 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f8cb417d6a4e2912d15a6d8bdffd1548cc649b49 commit r13-3008-gf8cb417d6a4e2912d15a6d8bdffd1548cc649b49 Author: Jason Merrill Date: Mon Sep 19 19:17:41 2022 +0200 c++: cast split_nonconstant_init return val to void We were already converting the result of expand_vec_init_expr to void; we need to do the same for split_nonconstant_init. The test that I noticed this with no longer fails without it. gcc/cp/ChangeLog: * cp-gimplify.cc (cp_genericize_init): Also convert the result of split_nonconstant_init to void. Diff: --- gcc/cp/cp-gimplify.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc index 73548888783..cca3b9fea33 100644 --- a/gcc/cp/cp-gimplify.cc +++ b/gcc/cp/cp-gimplify.cc @@ -892,13 +892,9 @@ omp_cxx_notice_variable (struct cp_genericize_omp_taskreg *omp_ctx, tree decl) static void cp_genericize_init (tree *replace, tree from, tree to) { + tree init = NULL_TREE; if (TREE_CODE (from) == VEC_INIT_EXPR) - { - tree init = expand_vec_init_expr (to, from, tf_warning_or_error); - - /* Make cp_gimplify_init_expr call replace_decl. */ - *replace = fold_convert (void_type_node, init); - } + init = expand_vec_init_expr (to, from, tf_warning_or_error); else if (flag_exceptions && TREE_CODE (from) == CONSTRUCTOR && TREE_SIDE_EFFECTS (from) @@ -906,7 +902,16 @@ cp_genericize_init (tree *replace, tree from, tree to) { to = cp_stabilize_reference (to); replace_placeholders (from, to); - *replace = split_nonconstant_init (to, from); + init = split_nonconstant_init (to, from); + } + + if (init) + { + if (*replace == from) + /* Make cp_gimplify_init_expr call replace_decl on this + TARGET_EXPR_INITIAL. */ + init = fold_convert (void_type_node, init); + *replace = init; } }