From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0825C3853549 for ; Sat, 1 Oct 2022 04:14:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0825C3853549 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664597688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JoOKAi5R1bmYY6F633fzBF4SpwIdWE+0Bi9GrSU2t78=; b=Uz9BCxLA4motEEiJN+8WV1pKuvuIO/8QhFmI29H46Ohn/1mll+K+yAwuCpvQ+Hs4rapt5B 2LNlWC1W0A+r386ct26TO2OeHIRisVnEHOprvtomdpZbGCVZVliOROX1IAY+emE2aHPa/7 iUkkY3boz1EfaP2W6U4DgggndjVOaGk= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-258-2wOGIPBmOkqsjLRP_SQg6Q-1; Sat, 01 Oct 2022 00:14:47 -0400 X-MC-Unique: 2wOGIPBmOkqsjLRP_SQg6Q-1 Received: by mail-qk1-f199.google.com with SMTP id bk21-20020a05620a1a1500b006be9f844c59so5166289qkb.9 for ; Fri, 30 Sep 2022 21:14:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date; bh=JoOKAi5R1bmYY6F633fzBF4SpwIdWE+0Bi9GrSU2t78=; b=iA1EXLiY4TagG/tOUC9At+mxs5Cv4cknAyA/iSgKvXpPxK6+NrWIhBa6M9fmprHAeo XyNCZgVnoW30q9PhgV6Rmufb3R59ol0ZcgjMv5IeYbytMwuVheszyoU+VZczynb7YAq1 FPu284nzFFvmL8P0FImwNLlR+Cijw9HWNPzdbOpWc76DG0knalzWDlIcVUNFlrIBY8OP 2a7mMJvluMuI/egx4DE4nTWB8wkFp3kNSd2JaM6KtPnO9MK4JRO8Oomzca59fbIlGrbU gpLVdy0ET7AU9Ez+3W/LS6pDYO8YQvVF/7IXUoe3J2v9x4wsbioZb79DweC+V6LXHKB3 601g== X-Gm-Message-State: ACrzQf3OIeIxIHqLw2P9fAn+QtWr4BzgWa4JEacV3g/pPReUSGPStuJv M5FxnVA2mU0L28eeR6tiiyR9nbrphPDW9ukiSbmvlkiHaF+1XpGbfnX2wMK2lY+jwldKDLPAS2/ VUqJU5XIGPknmBXgaRKGLnM5T+Pf8LQtucTsgb1f5BRh8CW2Sc9GyhRekxY9G9+ebZg== X-Received: by 2002:a05:6214:21a9:b0:4aa:b0e6:c6f5 with SMTP id t9-20020a05621421a900b004aab0e6c6f5mr9495775qvc.19.1664597686744; Fri, 30 Sep 2022 21:14:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44+6A5OVuW6HZzdhCzx0Ym9JbOQMMdLzFUGUYMCKZBi04Q3AQkM5yLbdEGprTW+a8xkoIT/w== X-Received: by 2002:a05:6214:21a9:b0:4aa:b0e6:c6f5 with SMTP id t9-20020a05621421a900b004aab0e6c6f5mr9495763qvc.19.1664597686305; Fri, 30 Sep 2022 21:14:46 -0700 (PDT) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id b6-20020ac812c6000000b0035a70a25651sm3481856qtj.55.2022.09.30.21.14.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 21:14:45 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: cast split_nonconstant_init return val to void Date: Sat, 1 Oct 2022 00:14:43 -0400 Message-Id: <20221001041443.2211752-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- 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. --- 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; } } base-commit: aa360fbf68b11e54017e8fa5b1bdb87ce7c19188 -- 2.31.1