From patchwork Fri Apr 21 11:47:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 86257 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1003552vqo; Fri, 21 Apr 2023 04:48:17 -0700 (PDT) X-Google-Smtp-Source: AKy350aGqI2QPxaeLDixnzKCDg/NzIZ+xy05fpt+RelgAsjV62HZmKXRN5yNURoZ8J2Ou/ymTAEZ X-Received: by 2002:a05:6402:48e:b0:506:bc26:d6a9 with SMTP id k14-20020a056402048e00b00506bc26d6a9mr5471348edv.8.1682077697595; Fri, 21 Apr 2023 04:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682077697; cv=none; d=google.com; s=arc-20160816; b=ufEi3xd7cQFz2G6lra7DaHHPJ4YdOAc32OjgiHICaVzcHatWws/UMi6ur5dljV+/r2 RSqhLsSjIccDcTensmnua2SJxjHstRRmGiqornSMRivFuE2S1RLygekxCEFZBViWcPQV RXQAaiww31SI79BQroIGl1B4BwBHnvfOxjsKghsM67Rk+7GzVr5XBDl6U+8IWyutc3lU Hx9La41rVp6F43ZNo0zwuq56O+bMHrWG4zE+2e66b4wdQI8QG//JN0vMduY8jrA37OxF xLsUmp2ehZ9MfQD/vqXvlOdxsTFyzAyRjmD4CDmMPxM9C5XnuZi0RSdHQavhxgbcHZTL YGTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=7x+ojzqnm6AZ+3DWPvJUgJ9pGd19W1a9667aLTcQubw=; b=AKD0/jStiLR/rZwS0vr7DakpRWbE1DJXl9awAcn0LK3WmZ3Bam6B9x2eeY7+QKTT+a l9IdLDOizAaEr+0UcwPakMGkERLB8YKj2yJPwFz+ajpMJ5FMlYp/RC7nBiAL4OPd/bzz I9is6IDhXP2D9nmpW2F2jG18UfVQDZr+2p366yJDWlldoFAru3EqUlbI1PCgtycHMcXV S2O9RMCxEJKYxGQ3lO03U+rvOkuvnBKYyD/8ArAAEIrGAEtD6gxpoDpn0ETpP+e3IZvO Va+4Jp8+z7gbk0WpPrUMWtdc1Zox1dfSpQISOaadz2W+4TW5DF4KPPH7sZq5gE0w8iw7 z+qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jLA9Gy2v; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z15-20020aa7c64f000000b00504b2a13d8esi3709282edr.216.2023.04.21.04.48.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 04:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jLA9Gy2v; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D10D3856DC4 for ; Fri, 21 Apr 2023 11:48:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D10D3856DC4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682077689; bh=7x+ojzqnm6AZ+3DWPvJUgJ9pGd19W1a9667aLTcQubw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=jLA9Gy2vn0yR2DNPcSNkxNcFJ4E+gUJltTjVzRHFy2ES4qXsEOWwRs/OJlNm60osA zcCuWSRupX2qflawqVmRf3cEQQmEgMYP9ykjOb7sH5wZp9hv2o2Tfc1jXe81BI++iI cw7KBVVHGPNt6wEU67uqODcrMyC2+jCmR5npQWjI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 57AD03858C83 for ; Fri, 21 Apr 2023 11:47:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57AD03858C83 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 839D91FDDC for ; Fri, 21 Apr 2023 11:47:22 +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 6D89F13456 for ; Fri, 21 Apr 2023 11:47:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QJWIGcp3QmTWHgAAMHmgww (envelope-from ) for ; Fri, 21 Apr 2023 11:47:22 +0000 Date: Fri, 21 Apr 2023 13:47:22 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/109573 - avoid ICEing on unexpected live def MIME-Version: 1.0 Message-Id: <20230421114722.6D89F13456@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763786304092227170?= X-GMAIL-MSGID: =?utf-8?q?1763786304092227170?= The following relaxes the assert in vectorizable_live_operation where we catch currently unhandled cases to also allow an intermediate copy as it happens here but also relax the assert to checking only. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/109573 * tree-vect-loop.cc (vectorizable_live_operation): Allow unhandled SSA copy as well. Demote assert to checking only. * g++.dg/vect/pr109573.cc: New testcase. --- gcc/testsuite/g++.dg/vect/pr109573.cc | 91 +++++++++++++++++++++++++++ gcc/tree-vect-loop.cc | 7 ++- 2 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/vect/pr109573.cc diff --git a/gcc/testsuite/g++.dg/vect/pr109573.cc b/gcc/testsuite/g++.dg/vect/pr109573.cc new file mode 100644 index 00000000000..d96f86f9579 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr109573.cc @@ -0,0 +1,91 @@ +// { dg-do compile } +// { dg-require-effective-target c++20 } + +void *operator new(__SIZE_TYPE__, void *__p) { return __p; } +template struct _Head_base { + _Head _M_head_impl; +}; +template struct _Tuple_impl; +template +struct _Tuple_impl<_Idx, _Head, _Tail...> : _Tuple_impl<_Idx + 1, _Tail...>, + _Head_base<_Head> { + template + _Tuple_impl(_UHead __head, _UTail... __tail) + : _Tuple_impl<_Idx + 1, _Tail...>(__tail...), _Head_base<_Head>(__head) {} +}; +template struct _Tuple_impl<_Idx, _Head> { + template _Tuple_impl(_UHead); +}; +template struct tuple : _Tuple_impl<0, _Elements...> { + template + tuple(_UElements... __elements) + : _Tuple_impl<0, _Elements...>(__elements...) {} +}; +unsigned long position_; +struct Zone { + template T *New(Args... args) { + return new (reinterpret_cast(position_)) T(args...); + } +}; +struct Label { + int pos_; + int near_link_pos_; +}; +enum Condition { below_equal }; +void bind(Label *); +Zone *zone(); +unsigned long deopt_info_address(); +int MakeDeferredCode___trans_tmp_2, MakeDeferredCode___trans_tmp_3, + Prologue___trans_tmp_6, MakeDeferredCode___trans_tmp_1; +struct MaglevAssembler { + template + void MakeDeferredCode(Function &&, Args &&...); + template + void JumpToDeferredIf(Condition, Function, Args... args) { + MakeDeferredCode(Function(), args...); + } + void Prologue(); +}; +struct ZoneLabelRef { + ZoneLabelRef(Zone *zone) : label_(zone->New