From patchwork Thu Jan 18 07:41:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 84324 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA59A385770C for ; Thu, 18 Jan 2024 07:42:31 +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 78A173857B8D for ; Thu, 18 Jan 2024 07:41:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78A173857B8D 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 78A173857B8D 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=1705563716; cv=none; b=a+FlK3JTVWxE+BJPomX3AX1cqanJFO+aGudnFNIK6JkVDN/zSTRU0aiAAXqEEc2Glwz1Rng2UF2VFzom9IRDsOOsat/5s1BRA73zj7hRaqHKqK+lFOblkk2eOkHpnL1dMZEUYKR/i/4McwlN/tMl/zGB8eQ1YeUDpNd1Gnma0kI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705563716; c=relaxed/simple; bh=5eC97ECh50tvEgOvZAJkQVDQ7MoWDky7NO1LxdAYRVA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Hu+qI+HvjWysmfH95hR534UE36Ac0VKXuSnXwcZStC559YoT011G0tTaZPKujGVHCzLA56KO82M7mSHm+SSOVFId3Lv1IHkrQVPFtnW/WwuRXtpGjOnpISVKL0a4xiV3D3tGb4US46QTdO9Df8Z31GphLQTcq6OQsq7wrH+nSWE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705563714; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=Ws21tZQoBx/6Ni6lVvykg+SVtwVowFWJYtMI1JwR/ac=; b=ONzh1mSBWhVCl0oOxEXWLHXYk5SRuogUfox+kDiqoOan3Lh1QUq5LjJl2m+0eC1eDKImkm boSt2HkriisJMsT0DLNZD5d8LDp0dAteroQd0dPb/iM31V1wwvOC0kFDXnTFhj2sio7LpN UA10Pc668F5RqrffPBJcE5COMHMq/tU= 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-654-RHR19TSANZm1RQPM8-FccQ-1; Thu, 18 Jan 2024 02:41:52 -0500 X-MC-Unique: RHR19TSANZm1RQPM8-FccQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 EBDC78352A5; Thu, 18 Jan 2024 07:41:51 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B068EC15D7E; Thu, 18 Jan 2024 07:41:51 +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 40I7fndA226877 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 18 Jan 2024 08:41:49 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40I7fm2i226873; Thu, 18 Jan 2024 08:41:48 +0100 Date: Thu, 18 Jan 2024 08:41:48 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Fix up scev-16.c test [PR113446] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.3 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+patchwork=sourceware.org@gcc.gnu.org Hi! This test FAILs on i686-linux or e.g. sparc*-solaris*, because it uses vect_int effective target outside of */vect/ testsuite. That is wrong, vect_int assumes the extra added flags by vect.exp by default, which aren't added in other testsuites. The following patch fixes that by moving the test into gcc.dg/vect/ and doing small tweaks. Regtested on x86_64-linux and i686-linux, ok for trunk? 2024-01-18 Jakub Jelinek PR tree-optimization/112774 PR testsuite/113446 * gcc.dg/tree-ssa/scev-16.c: Move test ... * gcc.dg/vect/pr112774.c: ... here. Add PR comment line, use dg-additional-options instead of dg-options and drop -fdump-tree-vect-details. Jakub --- gcc/testsuite/gcc.dg/tree-ssa/scev-16.c.jj 2023-12-08 08:28:23.790168953 +0100 +++ gcc/testsuite/gcc.dg/tree-ssa/scev-16.c 2024-01-17 18:21:26.397146209 +0100 @@ -1,18 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target vect_int } */ -/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */ - -int A[1024 * 2]; - -int foo (unsigned offset, unsigned N) -{ - int sum = 0; - - for (unsigned i = 0; i < N; i++) - sum += A[i + offset]; - - return sum; -} - -/* Loop can be vectorized by referring "i + offset" is nonwrapping from array. */ -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */ --- gcc/testsuite/gcc.dg/vect/pr112774.c.jj 2024-01-17 18:20:25.401978923 +0100 +++ gcc/testsuite/gcc.dg/vect/pr112774.c 2024-01-17 18:21:16.194285496 +0100 @@ -0,0 +1,19 @@ +/* PR tree-optimization/112774 */ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-additional-options "-O2 -ftree-vectorize" } */ + +int A[1024 * 2]; + +int foo (unsigned offset, unsigned N) +{ + int sum = 0; + + for (unsigned i = 0; i < N; i++) + sum += A[i + offset]; + + return sum; +} + +/* Loop can be vectorized by referring "i + offset" is nonwrapping from array. */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */