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 ABCD53858D33; Wed, 25 Oct 2023 09:44:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABCD53858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ABCD53858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698227092; cv=none; b=wCFjRedOcNaK+dwr4IzHs665IFZdBIdwkjAn8ksifiuV9YI2EOGgi41XolAlnaVOP5gvE6Di6lQR0wtZH8xgG+BkvC6tidOHQvfUE3mBxNY5dgM4Oa3yD8Mxh477tGqwOQWhmbvCGaILMUPCPgPs2WBHABECavpMefE81OPjjw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698227092; c=relaxed/simple; bh=N+Knh9WYcda8Effl71qRoFjQsLqo93Bc8c/7rNBTofs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Wbkbb8XsjU8oxgsUp6HHwOK5iEOGHEMgqdB8fjhS6apaab7NLEHZUgs6dkGJNr+8Yin6JdmfjSeDw/d7QN1ftZREUtQH0yORU4vZ7MW8msD3dOSwisxHfTzF5ogYsViH9H7TipR6MR0fMXJAErq04SqnH2LB978uXf/aToZ3UhQ= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: i5FfSJJgTVC3HU3oFYAAew== X-CSE-MsgGUID: c795115zSNuzKY/2RKTyXA== X-IronPort-AV: E=Sophos;i="6.03,250,1694764800"; d="scan'208,223";a="20693682" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 25 Oct 2023 01:44:47 -0800 IronPort-SDR: bIaRFuBPJWSX+5fQINGIpLRyhoZX+p+5GLXX0Nl6yd4vJDBMK8yHIg6OBI9OrTUkI51xM1XWfY yHyStPZxv3JevoGiYtH35sPOtyDnXZ4gJdfRPutywgtZP0hInliVcG5opAaJAM5waORtVBuRI4 ycnhamOZ2uHLIsiLU+TuYz5IrXKw0/QqDL6Ld/C3ZEtTLVe2j8jY8ys5vH5coSLKWMhdSZOvXm 8H2rzjpjOWVXbjp7K4r5qULLPx3GHbnuCFc7Gsbhw/1rEQ5r3X3rvIbYvH3j/sD+klkN4rTIrL ELE= From: Thomas Schwinge To: Chung-Lin Tang , , , Tobias Burnus CC: Catherine Moore Subject: Minor fixes for OpenACC/Fortran 'self' clause for compute constructs (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs) In-Reply-To: <87pm13w04d.fsf@euler.schwinge.homeip.net> References: <87pm13w04d.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Wed, 25 Oct 2023 11:44:38 +0200 Message-ID: <878r7rvxx5.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,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: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2023-10-25T10:57:06+0200, I wrote: > With minor textual conflicts resolved, I've pushed this to master branch > in commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a > "OpenACC 2.7: Implement self clause for compute constructs", see > attached. > > > I'll then apply/submit a number of follow-on commits. Regarding the Fortran front end changes: > From 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a Mon Sep 17 00:00:00 2001 > From: Chung-Lin Tang > Date: Tue, 13 Jun 2023 08:44:31 -0700 > Subject: [PATCH] OpenACC 2.7: Implement self clause for compute construct= s > --- a/gcc/fortran/gfortran.h > +++ b/gcc/fortran/gfortran.h > @@ -1546,6 +1546,7 @@ typedef struct gfc_omp_clauses > gfc_omp_namelist *lists[OMP_LIST_NUM]; > struct gfc_expr *if_expr; > struct gfc_expr *if_exprs[OMP_IF_LAST]; > + struct gfc_expr *self_expr; > struct gfc_expr *final_expr; > struct gfc_expr *num_threads; > struct gfc_expr *chunk_size; ..., this needs to be handled in a few more places, I think... > --- a/gcc/fortran/trans-openmp.cc > +++ b/gcc/fortran/trans-openmp.cc > @@ -6615,6 +6631,8 @@ gfc_split_omp_clauses (gfc_code *code, > /* And this is copied to all. */ > clausesa[GFC_OMP_SPLIT_TARGET].if_expr > =3D code->ext.omp_clauses->if_expr; > + clausesa[GFC_OMP_SPLIT_TARGET].self_expr > + =3D code->ext.omp_clauses->self_expr; > clausesa[GFC_OMP_SPLIT_TARGET].nowait > =3D code->ext.omp_clauses->nowait; > } ..., but this change isn't necessary: that function is for OpenMP only, and generally doesn't (have to) care about OpenACC-only clauses. OK to push the attached "Minor fixes for OpenACC/Fortran 'self' clause for compute constructs", or is anything more needed? Also, I've filed "Missing OpenACC/Fortran handling in 'gcc/fortran/frontend-passes.c'", which applies generally, not just to the OpenACC 'self' clause on compute constructs. Gr=C3=BC=C3=9Fe Thomas ----------------- 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Minor-fixes-for-OpenACC-Fortran-self-clause-for-comp.patch" >From 943de6d5f1498aabfc343bf5e9dd6c2b63fc55ed Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 20 Oct 2023 15:49:35 +0200 Subject: [PATCH] Minor fixes for OpenACC/Fortran 'self' clause for compute constructs ... to fix up recent commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a "OpenACC 2.7: Implement self clause for compute constructs". gcc/fortran/ * dump-parse-tree.cc (show_omp_clauses): Handle 'self_expr'. * openmp.cc (gfc_free_omp_clauses): Likewise. * trans-openmp.cc (gfc_split_omp_clauses): Don't handle 'self_expr'. --- gcc/fortran/dump-parse-tree.cc | 6 ++++++ gcc/fortran/openmp.cc | 1 + gcc/fortran/trans-openmp.cc | 2 -- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index cc4846e5d74..26391df46e6 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -1614,6 +1614,12 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses) show_expr (omp_clauses->if_exprs[i]); fputc (')', dumpfile); } + if (omp_clauses->self_expr) + { + fputs (" SELF(", dumpfile); + show_expr (omp_clauses->self_expr); + fputc (')', dumpfile); + } if (omp_clauses->final_expr) { fputs (" FINAL(", dumpfile); diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 2e2e23d567b..5e3cd0570bb 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -163,6 +163,7 @@ gfc_free_omp_clauses (gfc_omp_clauses *c) gfc_free_expr (c->if_expr); for (i = 0; i < OMP_IF_LAST; i++) gfc_free_expr (c->if_exprs[i]); + gfc_free_expr (c->self_expr); gfc_free_expr (c->final_expr); gfc_free_expr (c->num_threads); gfc_free_expr (c->chunk_size); diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc index 82bbc41b388..00782ee1716 100644 --- a/gcc/fortran/trans-openmp.cc +++ b/gcc/fortran/trans-openmp.cc @@ -6631,8 +6631,6 @@ gfc_split_omp_clauses (gfc_code *code, /* And this is copied to all. */ clausesa[GFC_OMP_SPLIT_TARGET].if_expr = code->ext.omp_clauses->if_expr; - clausesa[GFC_OMP_SPLIT_TARGET].self_expr - = code->ext.omp_clauses->self_expr; clausesa[GFC_OMP_SPLIT_TARGET].nowait = code->ext.omp_clauses->nowait; } -- 2.34.1 --=-=-=--