From patchwork Fri Jan 7 05:22:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1576474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=YlTwgtKp; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JVWpb5hzLz9sXM for ; Fri, 7 Jan 2022 16:23:34 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AADA33858013 for ; Fri, 7 Jan 2022 05:23:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AADA33858013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1641533009; bh=j0YWDjlswA1Y1++nJZNQbp4BG7/kc4DXVSHkYF4SeJ4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=YlTwgtKp2jCvaAQftQRjCRYD1qELmF3ZIAaJEyg+fx4161d30pW3B1aU9tc5kQZD+ 2iuyqLaluj7WxudR2EX7W3M5NaNUpSXeC/f7PCh1uGAX4/L3UxSc8Z6+W467xGPA9B QZmg2ouYwVcghqfx64UEFydACEO3sBne19gBGNBo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 676E03858408 for ; Fri, 7 Jan 2022 05:22:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 676E03858408 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-ohI5KdVNPRCKIQUzD6DXJQ-1; Fri, 07 Jan 2022 00:22:46 -0500 X-MC-Unique: ohI5KdVNPRCKIQUzD6DXJQ-1 Received: by mail-qk1-f197.google.com with SMTP id t8-20020a05620a0b0800b004764cabb1daso3364584qkg.12 for ; Thu, 06 Jan 2022 21:22:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=j0YWDjlswA1Y1++nJZNQbp4BG7/kc4DXVSHkYF4SeJ4=; b=C1VTJwR+u143uikzZjEQNwPoWTNJcWaboubkM0epaqRnokPe3T1ynaFSE9PuInnSx6 6LHZ8r2ukq+eXq1QFozxDZHpZenSNiOGmKwRBM2pLoEV8gPn0QMLKKm5zZF5QCVVDZyd 10kUjh5Dg70Jdv3rUDX0ZoC0GlP6jMzzcKMsMLAXUKv2Max32wTriglaB3iup4jQ9+ei cVCVAbPL/TwhkIuZ2aEfwUI+AWcB7kTtQAgGUibhIvN2fHjSGF5BVpTBSqHg/JihArVJ 3ybjoyHDHw9szqBC+tMXgvK8jlU7nUy+Entie972cQqzOV1GqRpZnIzCq7eV5S0FcPwg 0v2g== X-Gm-Message-State: AOAM5313NgB5/IYtm80xvKkmIOJAwOGRz4LZc2QqJebppg5Lt3O+2UBw 1ftODAJYzpqq53zBVXOrmcvCVrVDoFiL4eRijH9Me96rvgyLDTOgEjdSV4r50+BnIH+YOd+pkIo /pNj/8YNgLTA7rWBCTmpngh2DAWtZxgEVCI2dSXU0zq3enphV5hzU128fDIByuF/2ZA== X-Received: by 2002:a05:620a:2911:: with SMTP id m17mr6050243qkp.151.1641532965266; Thu, 06 Jan 2022 21:22:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwi1QvrWE5tDKL188a7YQOqVhWNGgjwZBf3IhzvNPZItnnHnBJHbU6uiUjYYCQ0oxc5taj93w== X-Received: by 2002:a05:620a:2911:: with SMTP id m17mr6050234qkp.151.1641532964816; Thu, 06 Jan 2022 21:22:44 -0800 (PST) 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 m1sm3069598qtk.34.2022.01.06.21.22.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 21:22:44 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: temporarily restore VEC_INIT_EXPR gimplify [PR103936] Date: Fri, 7 Jan 2022 00:22:42 -0500 Message-Id: <20220107052242.3018311-1-jason@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.2 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_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" PR103936 demonstrates that some VEC_INIT_EXPR can still survive into GENERIC; until that's fixed let's put back the handling in cp_gimplify_expr. PR c++/103936 PR c++/65591 gcc/cp/ChangeLog: * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling. gcc/testsuite/ChangeLog: * g++.dg/init/aggr15.C: New test. --- gcc/cp/cp-gimplify.c | 13 +++++++++++++ gcc/testsuite/g++.dg/init/aggr15.C | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/init/aggr15.C base-commit: 32d8ff73718fd07a9a7dfd2566d3b7b69f37b6bd prerequisite-patch-id: c8b7209fa1db3783c5225b16cb048a523ea374d1 prerequisite-patch-id: 663e00a9e27f9b6b2188c8872b028e3ceabd7f1d diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 114fa78b353..8b097c46158 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -469,6 +469,19 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) ret = GS_OK; break; + case VEC_INIT_EXPR: + { + *expr_p = expand_vec_init_expr (NULL_TREE, *expr_p, + tf_warning_or_error); + + hash_set pset; + cp_walk_tree (expr_p, cp_fold_r, &pset, NULL); + cp_genericize_tree (expr_p, false); + copy_if_shared (expr_p); + ret = GS_OK; + } + break; + case THROW_EXPR: /* FIXME communicate throw type to back end, probably by moving THROW_EXPR into ../tree.def. */ diff --git a/gcc/testsuite/g++.dg/init/aggr15.C b/gcc/testsuite/g++.dg/init/aggr15.C new file mode 100644 index 00000000000..a19a0f8e47b --- /dev/null +++ b/gcc/testsuite/g++.dg/init/aggr15.C @@ -0,0 +1,11 @@ +// PR c++/65591 + +struct ss { + ss() {}; +}; +struct C { + ss s[1000]; +}; +int main() { + C cs[5] = {}; +}