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: 207751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3266068dyb; Wed, 28 Feb 2024 02:53:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpHvj62pQsxrMbK5SRo5OA84DUgtmfZpDfWYfcgWyxgmdCo9GzhOOBlZlNqA1kYoy3B2Xm22i9GB5dfMvK1qwFmZfcRg== X-Google-Smtp-Source: AGHT+IHMe2koHy5hjS+VZ3HjBMv8uhMzojlEkoQzEbJXJtkymTlmnJqqTV0LKG9K4ZXuux9thhef X-Received: by 2002:ac8:4e54:0:b0:42e:8d5f:8375 with SMTP id e20-20020ac84e54000000b0042e8d5f8375mr7823106qtw.42.1709117601428; Wed, 28 Feb 2024 02:53:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709117601; cv=pass; d=google.com; s=arc-20160816; b=IsM1gqhaDQ4fKIMrWrXRinpNGlSnQW1o3SWYsE1frQKqpAqzLbnLY594+hX3sclJ6J 9p60NmqufTVqlJ3V/08oIKAR4f3cwj+EuNzfx4zR55/ULgszVVGRdP+pbB7dHpS7/BQU R9XXItQvjB8ca20MNhgnQI0R94d+zPx+IkFjqgcef7DMyghyDqA9uUb67IbWZ3KxwhG/ mXMHT9ORPxA6Y4bhhIdCbIN4w+xsjyzLXiHznXaBQRG5rBAePlj9IvBTPSbCSpvreFap e2A8Ih3xmAowH0n1CACDyONAk9ShgTPYkSP856RHRhfKvHMf5noDiuvq284rP7JlQjZF QrkA== 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 :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=iFXGhA36mLEhkiJwpe63HHZjnQNkwwERimppkWCxU5Q=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=j2SUGZJRNWV4/nTn/+KcZYYyPeCtbjauTEj5F8+BDpjY6Z4LpFqfYjvF5WkxcIbxPk NYr6+Lj+Ip1HParoFjOehZfAiVyp1FRkKPAVYesOe/ke8HSEXsDXKJiajjKQ2MZJ0oG/ 1wcdx4a2agBpamMEME/QW8kumY9MBR515FjSR/tII0Ogm7wz1lFia3X+4jP9vXgbJVug MfkN2gquzm0NT1NruZpaSRxuImcJD0oideIqHk+mxOi0apfcYvwU974Z39aimJyn26VG dAKUoDMxVR/KggK+HHv9LVSMKVc07pBfRiUfq3xkKrOGCeXXnP3PBxEuYrOageA04GsX BPAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RPPPbWA5; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 19-20020ac85713000000b0042eadf6c75bsi801344qtw.216.2024.02.28.02.53.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 02:53:21 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=RPPPbWA5; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 25C843858402 for ; Wed, 28 Feb 2024 10:53:21 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792139698027665296 X-GMAIL-MSGID: 1792139698027665296 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 (); + } +}