From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id BBA953858014 for ; Fri, 19 Nov 2021 07:57:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBA953858014 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C3A281FD39; Fri, 19 Nov 2021 07:57:01 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A8C4713A1F; Fri, 19 Nov 2021 07:57:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nA0IKM1Yl2GnTwAAMHmgww (envelope-from ); Fri, 19 Nov 2021 07:57:01 +0000 Date: Fri, 19 Nov 2021 08:57:01 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: jakub@redhat.com Subject: [PATCH] c++/103326 - fix ICE in tsubst with VECTOR_CST Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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-List-Received-Date: Fri, 19 Nov 2021 07:57:06 -0000 This adds missing handling of VECTOR_CST. Bootstrap and regtest pending on x86_64-unknown-linux-gnu, OK? Thanks, Richard. 2021-11-19 Richard Biener PR c++/103326 * pt.c (tsubst_copy): Handle VECTOR_CST. * g++.dg/pr103326.C: New testcase. --- gcc/cp/pt.c | 1 + gcc/testsuite/g++.dg/pr103326.C | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr103326.C diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b27eea33272..291003719f4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17249,6 +17249,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) case INTEGER_CST: case REAL_CST: case COMPLEX_CST: + case VECTOR_CST: { /* Instantiate any typedefs in the type. */ tree type = tsubst (TREE_TYPE (t), args, complain, in_decl); diff --git a/gcc/testsuite/g++.dg/pr103326.C b/gcc/testsuite/g++.dg/pr103326.C new file mode 100644 index 00000000000..260e7da86e8 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr103326.C @@ -0,0 +1,15 @@ +// { dg-do compile } +// { dg-require-effective-target c++11 } + +using x86_64_v16qi [[gnu::__vector_size__ (16)]] = char; + +template +void foo() +{ + constexpr x86_64_v16qi zero{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +} + +void foo2() +{ + foo(); +} -- 2.31.1