From patchwork Fri Nov 3 14:54:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 161330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1093134vqu; Fri, 3 Nov 2023 07:55:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFwrUblaV/3TGxb6s9ohsqRYbr5lw6TXdBEYjtTCOYqj5diK9aNOG9ELCQ7BzCzqo50eo4 X-Received: by 2002:a1f:1f06:0:b0:495:c464:a2fe with SMTP id f6-20020a1f1f06000000b00495c464a2femr19783653vkf.2.1699023305205; Fri, 03 Nov 2023 07:55:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1699023305; cv=pass; d=google.com; s=arc-20160816; b=O8WWSJOd4Qo1b1MAI5bpZEpOFFIJdFfnc9RwF+pTVDNLTlOoMxecWrdBPK8qGK5uNu K6Ww2VygZWHiQmLoLgGVN4maX2NKV8AWzSpDolfbD3kLQWizeLSX7rJzMV23UFTISSYv 5znKS9y+cDibxcoFoSaj5Sn2XbBGBv0NYFu8IkIWh/sew/w1DE9/d97AltjhX8BnlkUF 3Boj7FLAsP53lPhdp+8oms2sWRTIuGmUoUWGU9K2p81jpcw8sjTVmLdnqGMuc2CbZHsZ 25pYmiY8ZBGkHzlmfdS12EzkXiWjWeHrP7JkfBG6hrxTgfAmc9HkrXgNE62Dd/T2AQ6N Vgpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:mime-version:subject :to:from:date:dkim-signature:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=zOQdpvdhUjqc8AgQJqAaPviY4b+rjaFJB6qcc/WdbUg=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=vBVzuX1RVRg51BW6ex5nHYWziVTqNcSxz1ARgDa2ZVtyJNAwDVABDs0L11S/Mc+IRU KbMbq2cy64L4sMP/Xen3JvRdRgr+11hFUPhpwcoz/Wb+F6mk1hWL1y/KN7GtAIXaMjB9 j6of2YUjJR6T96zDtZmZrB5yTStluiH4UzTFCCuQk8YWsuWBEjzXPgkGBhFWeWpq3QGj l1hLBxc9qtxOEmt0C1zM8z7ie3WzVUQbYi4E6F9UZjCpi6CIx4TlKVdGQxCCKBU9+3IP BxcF0/7rh8YN5t1E4GqudThM8KM7JbhjmLRaOJfU2mDPDs1N9VegG2qZ4JMbqaj7HAY8 vqkA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AYVVTu87; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a8-20020ad441c8000000b0066cf62213d8si1620673qvq.58.2023.11.03.07.55.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AYVVTu87; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F054F385771C for ; Fri, 3 Nov 2023 14:55:04 +0000 (GMT) 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 [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id D40B03858D28 for ; Fri, 3 Nov 2023 14:54:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D40B03858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D40B03858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2178:6::1d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699023283; cv=none; b=CJnNcePPqESrymflTA7kSTEzv2ubpb1lZ+xumKKVCtdqDxxZmjo/GBaTThs/iscKFuZuq8N9ZUSpr4lsnP/6gFXix9cPt1CYemGR708PuhPEmLBpn6He2lfljsMs9/+0eRafVQTE0GcNifBz7R6MMd2/ZjR+XtqmIiOwQt2CFoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699023283; c=relaxed/simple; bh=+Ri4zDQy1Q2epyi+lPEcjS3ZOWi/bnWa0s7ZvM35rfI=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:MIME-Version: Message-Id; b=jIyB7aPQg1hRA5KG+UlUvQ/7E12LW5Yxo0NB5bscKLaEBRuXLmfUkvTvRNIibc9xfGh/i4+AQeV4bXKbnupztjvw8q8wASI0Z0mM5HJFTw7fCUrGmy8rXvNlIoKSCxDyM9hsAxG95S8S7VisHkqZ0YiRxxvfL3vYOU1Bdsuzy/A= ARC-Authentication-Results: i=1; server2.sourceware.org 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 A48C61F74D for ; Fri, 3 Nov 2023 14:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1699023271; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=zOQdpvdhUjqc8AgQJqAaPviY4b+rjaFJB6qcc/WdbUg=; b=AYVVTu87HfLNhZzTmzsPZeUxo3yzl3e5VOMe0f65wr1X0A/oDhVh9ZL9+3GdXqfMZBdA88 jErvRunNPs/pCVcwtjeycGVkrI3qhM1o3sTWkzCmGXFLDRb5xPFIw6sdz5saWP286SW7j7 rPF+9Hr4NDS6UhyZCrjKSLyLzcdksjk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1699023271; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=zOQdpvdhUjqc8AgQJqAaPviY4b+rjaFJB6qcc/WdbUg=; b=nNvCGZJ6R7X46qkWGe9BDIGdZl48dwHrgMPpPdi+yF7rEP2AkJY2XhNna8D4G2OG6cR577 O3ruRV1aIfWZtZAg== 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 910551348C for ; Fri, 3 Nov 2023 14:54:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MIv2IacJRWWUHwAAMHmgww (envelope-from ) for ; Fri, 03 Nov 2023 14:54:31 +0000 Date: Fri, 3 Nov 2023 15:54:31 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Testcases for vectorizer peeling MIME-Version: 1.0 Message-Id: <20231103145431.910551348C@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.2 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781555061260558570 X-GMAIL-MSGID: 1781555061260558570 The following exercise otherwise not exercised paths in the vectorizer peeling code, resulting in CPU 2017 build ICEs when patching but no fallout in the testsuite. tested on x86_64-unknown-linux-gnu, pushed. * gfortran.dg/20231103-1.f90: New testcase. * gfortran.dg/20231103-2.f90: Likewise. --- gcc/testsuite/gfortran.dg/20231103-1.f90 | 22 ++++++++++++++++++++++ gcc/testsuite/gfortran.dg/20231103-2.f90 | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/20231103-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/20231103-2.f90 diff --git a/gcc/testsuite/gfortran.dg/20231103-1.f90 b/gcc/testsuite/gfortran.dg/20231103-1.f90 new file mode 100644 index 00000000000..61ccf5c5e9d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/20231103-1.f90 @@ -0,0 +1,22 @@ +! { dg-do compile } +! { dg-options "-Ofast" } +SUBROUTINE sedi_1D(QX1d, DZ1d,kdir,BX1d,kbot,ktop) + real, dimension(:) :: QX1d,DZ1d + real, dimension(size(QX1d)) :: VVQ + logical BX_present + do k= kbot,ktop,kdir + VVQ= VV_Q0 + enddo + Vxmaxx= min0 + if (kdir==1) then + dzMIN = minval(DZ1d) + endif + npassx= Vxmaxx/dzMIN + DO nnn= 1,npassx + if (BX_present) then + do k= ktop,kdir + BX1d= iDZ1d0 + enddo + endif + ENDDO +END diff --git a/gcc/testsuite/gfortran.dg/20231103-2.f90 b/gcc/testsuite/gfortran.dg/20231103-2.f90 new file mode 100644 index 00000000000..c510505d5ad --- /dev/null +++ b/gcc/testsuite/gfortran.dg/20231103-2.f90 @@ -0,0 +1,22 @@ +! { dg-do compile } +! { dg-options "-Ofast" } +subroutine shr_map_checkFldStrshr_map_mapSet_dest(ndst,max0,eps,sum0,maxval0,min0,nidnjd,renorm) + allocatable sum(:) + logical renorm + allocate(sum(ndst)) + do n=1,ndst + if (sum0 > eps) then + rmax = max0 + endif + enddo + if (renorm) then + rmin = maxval0 + rmax = minval(sum) + do n=1,nidnjd + if (sum0 > eps) then + rmin = min0 + endif + enddo + write(*,*) rmin,rmax + endif +end