From patchwork Wed Feb 28 10:52:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1905657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RPPPbWA5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TlB5p2tHKz23qN for ; Wed, 28 Feb 2024 21:53:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 22E693858C35 for ; Wed, 28 Feb 2024 10:53:00 +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.129.124]) by sourceware.org (Postfix) with ESMTPS id 644763858C62 for ; Wed, 28 Feb 2024 10:52:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 644763858C62 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 644763858C62 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709117563; cv=none; b=Z4nDQzGBRe6jHpOcApJr/cIqPNZSxEab75WXnd9V0ee+ONyOAEncoQ8n3s2oUaApLOLXl3LuapuOo1fkIWPmxMhOT2gj7gFMBfEL5nlt68po24DVksPgqpuV7vd49vQVBkBxkQC1o7zecqDv1r1yfne4DNiewjTkMVCvTtVVLm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709117563; c=relaxed/simple; bh=aAYLSaOAXJkClZYwQ0P0jSpaXPs5lWpGHx/UVzx3l1Q=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=gJ771Wm7bg3eohL84bsaQqGuUXjG5Po0EdJupV74KAaAemMaOMHCBFsqz7ClTW0JvLTehRTy5I4LjBodbtoHLuenHvO9jHToKdyTs42DLc/zEPAE6+8cRqm3tr+KSEJ/19L155TPIXKIlE5Ddg1Z+vd152bcVMKlJefrhSrG2W0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709117555; 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; bh=iFXGhA36mLEhkiJwpe63HHZjnQNkwwERimppkWCxU5Q=; b=RPPPbWA5kDrrCKOw6UdUXs0ZhO1r3KKgooMinr2g09TBA1xsScbsT1/QrcBHugJog4mAtA DJ1ACplPCmErLVh0mxKOCVNDuxvo/TwHpWyMqyDivNipLvE5d0Io8M7ddZAFYHFXR8EhI8 L+FwwH6mbTGssVaS+WN0hadYgyGMKvc= 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-335-zHlBbK7_NrCaNEB3FtPlfg-1; Wed, 28 Feb 2024 05:52:34 -0500 X-MC-Unique: zHlBbK7_NrCaNEB3FtPlfg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 1584D10C04E5 for ; Wed, 28 Feb 2024 10:52:34 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEBBB492BE8 for ; Wed, 28 Feb 2024 10:52:33 +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 41SAqVbD3006359 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 28 Feb 2024 11:52:31 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 41SAqVi33006358 for gcc-patches@gcc.gnu.org; Wed, 28 Feb 2024 11:52:31 +0100 Date: Wed, 28 Feb 2024 11:52:30 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcase for recently fixed PR [PR114075] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.5 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_H2, 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! This adds testcase from PR114075 which has been fixed by the r14-9205 change on s390x-linux with -march=z13. Tested on x86_64-linux -m32/-m64 and using a cross to s390x-linux before/after r14-9205 with subsequent execution on s390x hw. Committed to trunk as obvious. 2024-02-28 Jakub Jelinek PR tree-optimization/114075 * gcc.dg/gomp/pr114075.c: New test. Jakub --- gcc/testsuite/gcc.dg/gomp/pr114075.c.jj 2024-02-28 11:37:52.370765940 +0100 +++ gcc/testsuite/gcc.dg/gomp/pr114075.c 2024-02-28 11:38:58.080850058 +0100 @@ -0,0 +1,31 @@ +/* PR tree-optimization/114075 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fopenmp-simd -Wno-psabi" } */ + +typedef float V __attribute__((__vector_size__ (16))); + +__attribute__((__always_inline__)) inline static float +foo (V a) +{ + float r = 0; +#pragma omp simd reduction(+:r) + for (unsigned long i = 0; i < (sizeof (a) / sizeof (float)); i++) + r += a[i]; + return r; +} + +int +main () +{ + static const struct { V a; float r; } t[] = { + { (V) { -17.0f, -18.0f, -19.0f, 20.0f }, -34.0f }, + { (V) { 18.5f, 19.125f, 20.5f, -38.25f }, 19.875f }, + { (V) { -8.25f, 16.75f, -42.5f, -18.75f }, -52.75f } + }; + for (unsigned long i = 0; i < (sizeof (t) / sizeof (t[0])); i++) + { + float r = foo (t[i].a); + if (r != t[i].r) + __builtin_abort (); + } +}