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 D06543959E59; Wed, 24 Feb 2021 21:57:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D06543959E59 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Julian_Brown@mentor.com IronPort-SDR: nGLuoNGJX0EE/SOdx3Z8I8wc+tkoQapOxweZD+zl/D2Bym8fV8aUUnRjhjDbTKPmriXwqJJ+40 PUp/TZqFdQQ+JlI3M/NB3DhAKtkFkwAXdbQsJota1yL7OmIG9DZjVMfGE4e1lYBeJZjO1yDqgf s2xWW9JJ+8hQx3bIH1/HVYmZe65+pilTTrArNxwmFhBPMppCXBLg6NwnLtScIaUamYBwV8l8LU cH8zE/DBJ8X2z4COuaamgmwU8MmN4pSa0kn3a7T71YVcORB4GE00Ni7/WRrRAk9g0RiPYZ1676 n6k= X-IronPort-AV: E=Sophos;i="5.81,203,1610438400"; d="scan'208";a="58597697" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 24 Feb 2021 13:57:45 -0800 IronPort-SDR: nhkRmnmckDtBVwqf63Tn5XgGCtav6IgLvwEICHDiswmu8nYvb8VIyuw8G1Rmw4pVhb+JgC7enl 2QeF9VPnjnuZkrswCv/NTDCBlYLKK+C7ub0fFO0pbbAQgvFUzOiOSDkwvmRw3KsbdKdwS7nN9/ gyFF2cMPcyb1lSzMSUBcel1Ds0oc7dYgzm5fUMDqKx72GWYyrqHsp0oIleTx/hoci3NO3lV3Bp OWjDUTTG1/6NPq+oZN2gX6YYO6uOf2DYYiENOajm36Rx7Cmtr5RITlGbq+SNs+iZGrCuvki0Kh PdU= From: Julian Brown To: CC: , Tobias Burnus Subject: [PATCH 2/7] [og10] openacc: Use class_pointer instead of pointer attribute for class types Date: Wed, 24 Feb 2021 13:57:23 -0800 Message-ID: <20210224215726.129681-3-julian@codesourcery.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210224215726.129681-1-julian@codesourcery.com> References: <20210224215726.129681-1-julian@codesourcery.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.0 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2021 21:57:47 -0000 Elsewhere in the Fortran front-end, the class_pointer attribute is used for BT_CLASS entities instead of the pointer attribute. This patch follows suit for OpenACC. I couldn't actually come up with a test case where this makes a difference (i.e., where "class_pointer" and "pointer" have different values at this point in the code), but this may nonetheless fix a latent bug. gcc/fortran/ * trans-openmp.c (gfc_trans_omp_clauses): Use class_pointer attribute for BT_CLASS. (cherry picked from commit f743fe231663e32d52db987650d0ec3381a777af) --- gcc/fortran/ChangeLog.omp | 7 +++++++ gcc/fortran/trans-openmp.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp index 9e0cf7198acf..2dd82a70cb71 100644 --- a/gcc/fortran/ChangeLog.omp +++ b/gcc/fortran/ChangeLog.omp @@ -1,3 +1,10 @@ +2021-02-24 Julian Brown + + Backport from mainline + + * trans-openmp.c (gfc_trans_omp_clauses): Use class_pointer attribute + for BT_CLASS. + 2021-02-24 Julian Brown Backport from mainline diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index e53f7ebb7d7f..d0e299b02142 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -2973,7 +2973,10 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, if (lastcomp->u.c.component->ts.type == BT_DERIVED || lastcomp->u.c.component->ts.type == BT_CLASS) { - if (sym_attr.pointer || (openacc && sym_attr.allocatable)) + bool pointer + = (lastcomp->u.c.component->ts.type == BT_CLASS + ? sym_attr.class_pointer : sym_attr.pointer); + if (pointer || (openacc && sym_attr.allocatable)) { tree data, size; -- 2.29.2