From patchwork Wed Oct 19 15:37:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 5695 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp392967wrs; Wed, 19 Oct 2022 08:37:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LPvDelKewiUBa8DhZku/CbZB7hTXFHQetiQComJX9RXv4FfbfYjfAE4naycKtSsIA/3tv X-Received: by 2002:a17:906:5dae:b0:78e:3109:36d1 with SMTP id n14-20020a1709065dae00b0078e310936d1mr7345568ejv.470.1666193873810; Wed, 19 Oct 2022 08:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666193873; cv=none; d=google.com; s=arc-20160816; b=vo0phLGXZaHxOH1BdmNqOW7D6Yc+UWyxxB9Jl0uEpy9cmUoeLsG59gnR0sjrCh98S6 W+RgkN6tNPlMK/kTPqHXBmZrXg8eMDkRcjjqby+Snq2QHmvVqf6EyQwYz90q+CNZpUlS XPv19/72Nps5GgRZUvYRoVvrn8HWbhLhtOt4ItrKjfW4Y8jMUsih444xZ2qd64vr2zGr K5p6uPW/FVBUF4krx388BmVmTW2t+1J/IZFPta4djJD8QUw3TfssqZeDhwPLXTyfF4tr Pgv+7MD5JFQ78rY+7QKYfkui8YQhA21+zjrKSS3R5NPWPuJcxvE/1gIQYaF+LH9DXWF6 etwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=mU98KefpSmwHbY/DNMy4ouTg4eYdRPa/kvr/gQE3wD0=; b=OWMhHCcXengdCv+ivCti96/GFAyOXXNSprMJYwkksT5f6SoiBTvLgdll5j3Y0+mvig 2+oI8ECUcbTTTdrAGeEGKhAguPxrgdmH3bZbGxwtj+nCEDoIZTmwwJYFLxyj4ZgzUH0w lDnPkC2nLef555xt3a5/f6r6mW3cioH+eRdFpggYm7E/xzhY1hTiX3xTuSHKki7p1Qq2 w7C5qiBWkBQAzFvrIS3meTjdkAW5DcwaYXp25UuiofycWt/9fFL6yHl+fBWDVKT4n/gR sPXuBeHR2mz5UP3wBRG/27ZMHEwmpCtQ1QVer3v770iFCdtaeZqgieti4t6UFGKAe8TA X3hw== ARC-Authentication-Results: i=1; mx.google.com; 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" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q16-20020a056402519000b004584decbde1si17629917edd.369.2022.10.19.08.37.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 08:37:53 -0700 (PDT) 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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23273385800F for ; Wed, 19 Oct 2022 15:37:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id B0D163858D39 for ; Wed, 19 Oct 2022 15:37:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0D163858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,196,1661846400"; d="diff'?scan'208";a="84874091" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 19 Oct 2022 07:37:23 -0800 IronPort-SDR: PcrxpoFVIR0IHpDyYjD/KdNPptQoCkPq3+dGi7ucPDGphxOh0w+PgGenWBq1GpIKOVvv4CkJ02 yosLN36bqW0xlkPCw8oEFfQ3+bAKQ7EOjZnqIjPaCNWsSaYGfajT9HoHJG05ypXtPXXz9N+E1l 8vI6TA3c5NBNeRm+BgZQzVvo9L0TQ85N2jLWerEpCBEULjZ0YgaFEYl3fKoI+3aC6lL0AOr72e KKjNKFf7JzC4md/3M9nJsYLrChV6V6nlioJbd/s5QxBWYOHGbfMWH2QRttpoWtNIXK8yFhJQb8 5ho= Message-ID: Date: Wed, 19 Oct 2022 17:37:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Content-Language: en-US To: gcc-patches From: Tobias Burnus Subject: [OG12][committed] Fix omp-expand.cc's expand_omp_target for OpenACC X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747130907311002703?= X-GMAIL-MSGID: =?utf-8?q?1747130907311002703?= Fallout of my Fortran deep-mapping patch, which I somehow missed – probably because being inundated by the OG11 OpenACC fails back then. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 commit 0d6fc5032c7ba8a95301d0ccbc418875e73955ac Author: Tobias Burnus Date: Wed Oct 19 17:31:14 2022 +0200 Fix omp-expand.cc's expand_omp_target for OpenACC In OG12 commit a6c1eccffb161130351d891dc87f5afe54f8075c, "Fortran/OpenMP: Support mapping of DT with allocatable components" the size of the addr/sizes/kind arrays was passed as 4th argument. However, OpenACC uses >3 arguments for its own purpose, e.g. to handle noncontiguous arrays by passing an array descriptor there. This patch restores the previous behaviour for OpenACC, fixing testcases like libgomp.oacc-c-c++-common/noncontig_array-1.c. gcc/ * omp-expand.cc (expand_omp_target): Fix OpenACC in case there are more than 3 arguments to the builtin function. --- gcc/ChangeLog.omp | 5 +++++ gcc/omp-expand.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 527a9850dba..32a8c7b485f 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,8 @@ +2022-10-19 Tobias Burnus + + * omp-expand.cc (expand_omp_target): Fix OpenACC in case there + are more than 3 arguments to the builtin function. + 2022-10-17 Thomas Schwinge Backported from master: diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc index 92996685d41..6529f63362b 100644 --- a/gcc/omp-expand.cc +++ b/gcc/omp-expand.cc @@ -10456,7 +10456,7 @@ expand_omp_target (struct omp_region *region) t3 = t2; t4 = t2; } - else if (TREE_VEC_LENGTH (t) == 3) + else if (TREE_VEC_LENGTH (t) == 3 || is_gimple_omp_oacc (entry_stmt)) { t1 = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (TREE_VEC_ELT (t, 1)))); t1 = size_binop (PLUS_EXPR, t1, size_int (1)); commit 92b14810a2743594df945dc6479413a3d9d943aa Author: Tobias Burnus Date: Wed Oct 19 17:26:34 2022 +0200 ChangeLog for "Fortran: Fix delinearization regression" Missed to update gcc/fortran/ChangeLog.omp and to include the following in previous commit, i.e. commit 76b773a4a2d1daf0b83e50cd999bc38f8dd047be. gcc/fortran/ChangeLog: * trans-array.cc (non_negative_strides_array_p): Fix handling of GFC_DECL_SAVED_DESCRIPTOR. (gfc_conv_array_ref): Use ARRAY_REF again when possible. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/affinity-clause-1.f90: Revert to upsteam version, update one scan-tree item. * gfortran.dg/gomp/depend-4.f90: Revert to upstream version. * gfortran.dg/gomp/depend-5.f90: Likewise. * gfortran.dg/gomp/depend-6.f90: Likewise. --- gcc/fortran/ChangeLog.omp | 6 ++++++ gcc/testsuite/ChangeLog.omp | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp index 685fe68667a..189431df4eb 100644 --- a/gcc/fortran/ChangeLog.omp +++ b/gcc/fortran/ChangeLog.omp @@ -1,3 +1,9 @@ +2022-10-19 Tobias Burnus + + * trans-array.cc (non_negative_strides_array_p): Fix handling + of GFC_DECL_SAVED_DESCRIPTOR. + (gfc_conv_array_ref): Use ARRAY_REF again when possible. + 2022-10-17 Tobias Burnus Backport from mainline: diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp index b2b4381e3ce..6928d520c0f 100644 --- a/gcc/testsuite/ChangeLog.omp +++ b/gcc/testsuite/ChangeLog.omp @@ -1,3 +1,11 @@ +2022-10-19 Tobias Burnus + + * gfortran.dg/gomp/affinity-clause-1.f90: Revert to upsteam version, + update one scan-tree item. + * gfortran.dg/gomp/depend-4.f90: Revert to upstream version. + * gfortran.dg/gomp/depend-5.f90: Likewise. + * gfortran.dg/gomp/depend-6.f90: Likewise. + 2022-10-17 Tobias Burnus Backport from mainline: