From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 335FE3858016 for ; Wed, 28 Sep 2022 15:17:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 335FE3858016 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.93,352,1654588800"; d="scan'208,217";a="83782108" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 28 Sep 2022 07:17:37 -0800 IronPort-SDR: 0ZXCB225ePvDZ8vumiyKy7znTdWN2i7RBv0H+XYx3mxwwc19XUd6CX8MdSDUJcA29F70Lvk0C8 FFgu14u1KXSWN3ARQVseByy0cYz7/Ik+CMkU9HTt2MDwC+f8lWItDP0DRSZXy9sYFxB71AunSC JoV/9RRxly5Mx0R7wUq7mE7HNS5Dwt0QGV/+nJGAGmQYOseMUc6GXnU4uy+cg6o8GkuLNM/eAQ NFLTa9ZYPGYTKah+5cdRefAy9271yzIvoJ02ePZaeHx4bKyGi8DhIH5pejwREr4bOtzrz+4K4P XFg= Content-Type: multipart/alternative; boundary="------------6N0X0PFOYyuydZ0GL0qxWmrG" Message-ID: <66a6261f-cf6f-3a54-b928-eb86ffab4db7@codesourcery.com> Date: Wed, 28 Sep 2022 17:17:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH] OpenACC: whole struct vs. component mappings (PR107028) Content-Language: en-US To: Julian Brown , CC: Jakub Jelinek , References: <20220928132024.64984-1-julian@codesourcery.com> From: Tobias Burnus In-Reply-To: <20220928132024.64984-1-julian@codesourcery.com> X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,KAM_DMARC_STATUS,NICE_REPLY_A,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 List-Id: --------------6N0X0PFOYyuydZ0GL0qxWmrG Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable On 28.09.22 15:20, Julian Brown wrote: This patch fixes an ICE when both a complete struct variable and components of that struct are mapped on the same directive for OpenACC, using a modified version of the scheme used for OpenMP in the following patch [...] Tested with offloading to NVPTX. OK? OpenACC comments: I do note that there are now two "appears more than once in map clauses". T= he newly added error_at in oacc_resolve_clause_dependencies is triggered by gcc/testsuite/gfortran.dg/goacc/{derived-types-3.f90,goacc/mapping-tests-{1= ,4}.f90}. However, it looks as if no testcase triggers anymore the OpenACC-only error= _at in omp_accumulate_sibling_list. My impression is that the oacc_resolve_clau= se_dependencies check + 'if (grp->deleted) continue;' in the sibling-list function makes th= is difficult to hit. I don't see immediately whether some cases can still reach omp_accumulate_s= ibling_list =E2=80=93 if so, a testcase would be nice, or whether that error_at can now be remove= d. However, I note that *without* the patch, the *following* *error* triggers = =E2=80=93 while it compiles *silently* *with* the *patch* applied: 15 | !$acc enter data copyin(x%A, x%A%i(5), x%A%i(5)) | ^ Error: =E2=80=98x.a.i=E2=80=99 appears more than once in map clauses 15 | !$acc enter data copyin(x%A, x%A%i(5), x%A%i(4)) | ^ Error: =E2=80=98x.a.i=E2=80=99 appears more than once in map clauses BTW: The two testcases differ by the array-element: '5'/'5' vs. '5'/'4'. Testcase is a modified existing one: --- a/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90 @@ -3 +3 @@ subroutine foo - integer i, j + integer i(5), j @@ -15 +15 @@ subroutine foo - !$acc enter data copyin(x%A, x%A%i, x%A%i) + !$acc enter data copyin(x%A, x%A%i(5), x%A%i(4)) Otherwise, the patch looks sensible - as far as I understand it. However, it surely would help if Thomas and/or Jakub could have a second lo= ok. Tobias 2022-09-28 Julian Brown gcc/ PR middle-end/107028 * gimplify.cc (omp_group_base): Fix IF_PRESENT handling. (omp_check_mapping_compatibility, oacc_resolve_clause_dependencies): New functions. (build_struct_sibling_lists): Skip deleted groups. Don't build sib= ling list for struct variables that are fully mapped on the same directi= ve for OpenACC. (gimplify_scan_omp_clauses): Call oacc_resolve_clause_dependencies. gcc/testsuite/ PR middle-end/107028 * c-c++-common/goacc/struct-component-kind-1.c: New test. * g++.dg/goacc/pr107028-1.C: New test. * g++.dg/goacc/pr107028-2.C: New test. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --------------6N0X0PFOYyuydZ0GL0qxWmrG--