From patchwork Tue Nov 28 08:57:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 170637 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3773781vqx; Tue, 28 Nov 2023 00:58:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF99TQyGRVQC1aYoNpOI67fIoJCchN+m9C6LpbfcsiMxn05ghtcq64/IoRtEzsTyuZPBMcV X-Received: by 2002:a0c:f608:0:b0:67a:33a3:76e5 with SMTP id r8-20020a0cf608000000b0067a33a376e5mr8972119qvm.34.1701161894561; Tue, 28 Nov 2023 00:58:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701161894; cv=pass; d=google.com; s=arc-20160816; b=yScGDFwafoo7xH5oe7VDgZ4SlP2/DD3vdsWoAJKNL5dSeMahwySxLHk3g5pMbjK9Lf naQ6/u+cJOVfPgpIfzDWys3VhbEYIB7JZeLI1y6VehSGU5yrXBUonKmw7dtUhCOdOJya tBX1XVPcDb39pFsuoVn3eCsIDOqBPxMoxDKYN3muPAZVcUzLjy8PoKwlYJQoMz3LquuT PB0NGluUNbRMsQIck34r7FUByHywkSZYrO8PFNoitS6pLt6fBafbuTqGg01eMZMKvXpV tfk58YBc6UQnYXMeBJWg0K7i8XMg4/2UJI6HDMPWGUY5vC1p8/3lLSauTHJnzl54Xb6R S+cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition:in-reply-to :mime-version:references:message-id:subject:to:from:date :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=KnjDD3VV00++d4mpUqnKQ6jxrHC93Zw190+FI/Nt0Ag=; fh=2ARjLJT01vBeuOQakm5XQgQm1qPkR/xi7/YALZtKSds=; b=fjGzcrn97Pb0+39hYdphVNgXhTx2e1rGXssEAC3+PSTHDUCjmOVENZvOKNDTrS5uWN jGXStgPfu3GjEklVXv6pnidtMy+7h6PxptDq9HQo0JgUGomNPgdwK7NL8hpEn2cDfVv1 5AnSul9N3jC0Fntneqj4qAMgPR+e11csXyOeZTGbMk28lp5/pyDrJ1f8TQ+4N4bbMWJu fDAj+VsBsDM26pNElPmfP3pK8IUgZOU8u67mDXk0Wu2/tghO5gNBsQ1yCrFvZwRuufE4 hTWtKNmnF+K6EzKMDnw+KtoRwGs5NN4wwTXsArhyQPf3d+qCfYSg/JWbR1lB256AZcxG RTlw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q1Nqkqxk; 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=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y16-20020ad457d0000000b0066d02899548si11112776qvx.34.2023.11.28.00.58.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:58:14 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=Q1Nqkqxk; 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=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 468053875460 for ; Tue, 28 Nov 2023 08:58:14 +0000 (GMT) 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 F15B33847700 for ; Tue, 28 Nov 2023 08:57:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F15B33847700 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F15B33847700 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701161870; cv=none; b=aveXaPrkSoOXOo8sbXzWWMM5dhFmmeHR4fcjGOy0SFzxwt/OH7CZ/LsGZptzibXtUp+VHiYMgPch9voZBUrKVhIOwMOLIswaqJwEgu/TV+DOpIeERSEC1XRC1eY0MNI4V3AwknFmqSyAuAJwSVbPi/A5kp/6j24mBKFQk3EhNUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701161870; c=relaxed/simple; bh=NsPXpfxIGYN3fdNhr4VzLJYK71Hp5F8pTHS7iYPlOBc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=PEUSGMEFjCbWYC5e11b8PO1A52EVdw83YbUgHvBCHGyR8TET2EW9f31N6Mp9i4Ndi2om+6KIyS5AviTrKr2spK/izJCQwO22rZZs21Zn4fNltlWA526Xi4DM86dRrl8lrAPTLBaQVoFclypBuaUQiY/NkVCUlGD9IYgt3tZmCH0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701161868; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=KnjDD3VV00++d4mpUqnKQ6jxrHC93Zw190+FI/Nt0Ag=; b=Q1NqkqxkOPEISqmxQZBcoKHqe+omcnN+LdYL+4IBZv98O3+mi1EbEAvzpx5AKjy/Ymju1w B+FjVk6AK/zdrB6I7BZiSWwmlfR3dYYrKqCxp3+KZqB8qVhrAdXFEYkCXzZpxYtIdtdS1z q1XIRkQN1J73H4vqHl2j4D3QhV5gbHo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-T30eAkOkOwSH0I-CHQIyQA-1; Tue, 28 Nov 2023 03:57:42 -0500 X-MC-Unique: T30eAkOkOwSH0I-CHQIyQA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1FA7881C84; Tue, 28 Nov 2023 08:57:41 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F30B492BEF; Tue, 28 Nov 2023 08:57:41 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3AS8vc9g489229 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 09:57:39 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3AS8vbgv489228; Tue, 28 Nov 2023 09:57:37 +0100 Date: Tue, 28 Nov 2023 09:57:37 +0100 From: Jakub Jelinek To: "prathamesh.kulkarni" , "juzhe.zhong@rivai.ai" , gcc-patches , "richard.sandiford" Subject: [PATCH] testsuite: Fix up pr111754.c test Message-ID: References: <0E364CF57C9D73AC+202311281556465482658@rivai.ai> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783797534680227224 X-GMAIL-MSGID: 1783797534680227224 On Tue, Nov 28, 2023 at 09:43:52AM +0100, Jakub Jelinek wrote: > On Tue, Nov 28, 2023 at 03:56:47PM +0800, juzhe.zhong@rivai.ai wrote: > > Hi, there is a regression in RISC-V caused by this patch: > > > > FAIL: gcc.dg/vect/pr111754.c -flto -ffat-lto-objects scan-tree-dump optimized "return { 0.0, 9.0e\\+0, 0.0, 0.0 }" > > FAIL: gcc.dg/vect/pr111754.c scan-tree-dump optimized "return { 0.0, 9.0e\\+0, 0.0, 0.0 }" > > > > I have checked the dump is : > > F foo (F a, F b) > > { > > [local count: 1073741824]: > > = { 0.0, 9.0e+0, 0.0, 0.0 }; > > return ; > > > > } > > > > The dump IR seems reasonable to me. > > I wonder whether we should walk around in RISC-V backend to generate the same IR as ARM SVE ? > > Or we should adjust the test ? > > Note, the test also FAILs on i686-linux (but not e.g. on x86_64-linux): > /home/jakub/src/gcc/obj67/gcc/xgcc -B/home/jakub/src/gcc/obj67/gcc/ /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c -fdiagnostics-plain-output -O2 -fdump-tree-optimized -S -o pr111754.s > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c: In function 'foo': > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c:7:1: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi] > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c:6:3: note: the ABI for passing parameters with 16-byte alignment has changed in GCC 4.6 > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c:6:3: warning: SSE vector argument without SSE enabled changes the ABI [-Wpsabi] > FAIL: gcc.dg/vect/pr111754.c (test for excess errors) > Excess errors: > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c:7:1: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi] > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/vect/pr111754.c:6:3: warning: SSE vector argument without SSE enabled changes the ABI [-Wpsabi] > > PASS: gcc.dg/vect/pr111754.c scan-tree-dump-not optimized "VEC_PERM_EXPR" > FAIL: gcc.dg/vect/pr111754.c scan-tree-dump optimized "return { 0.0, 9.0e\\+0, 0.0, 0.0 }" > > So, I think it is wrong to specify > /* { dg-options "-O2 -fdump-tree-optimized" } */ > in the test, should be dg-additional-options instead, so that it gets > the implied vector compilation options e.g. for i686-linux (-msse2 in that > case at least), question is if -Wno-psabi should be added as well or not, > and certainly the scan-tree-dump needs to be guarded by appropriate > vect_* effective target (but dunno which, one which asserts support for > V4SFmode and returning it). > Alternatively, perhaps don't check optimized dump but some earlier one > before generic vector lowering, then hopefully it could match on all > targets? Maybe with the = ... vs. return ... variants. All in one patch now. Tested on x86_64-linux with make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-mno-sse,-m64\} vect.exp=pr111754.c' Ok for trunk? 2023-11-28 Jakub Jelinek PR middle-end/111754 * gcc.dg/vect/pr111754.c: Use dg-additional-options rather than dg-options, add -Wno-psabi and use -fdump-tree-forwprop1 rather than -fdump-tree-optimized. Scan forwprop1 dump rather than optimized and scan for either direct return or setting of to the vector. Jakub --- gcc/testsuite/gcc.dg/vect/pr111754.c.jj 2023-11-28 08:46:28.422801989 +0100 +++ gcc/testsuite/gcc.dg/vect/pr111754.c 2023-11-28 09:52:56.761059292 +0100 @@ -1,5 +1,6 @@ +/* PR middle-end/111754 */ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-additional-options "-O2 -fdump-tree-forwprop1 -Wno-psabi" } */ typedef float __attribute__((__vector_size__ (16))) F; @@ -9,5 +10,5 @@ F foo (F a, F b) return __builtin_shufflevector (v, v, 1, 0, 1, 2); } -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */ -/* { dg-final { scan-tree-dump "return \{ 0.0, 9.0e\\+0, 0.0, 0.0 \}" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */ +/* { dg-final { scan-tree-dump "(return| =) \{ 0.0, 9.0e\\+0, 0.0, 0.0 \}" "forwprop1" } } */