From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102117 invoked by alias); 29 May 2019 17:00:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 101914 invoked by uid 89); 29 May 2019 17:00:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=is_reference, ompgeneralc, 20051015, 23.000000000 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 May 2019 17:00:04 +0000 Received: from svr-orw-mbx-05.mgc.mentorg.com ([147.34.90.205]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hW1vj-0002V8-9Y from Thomas_Schwinge@mentor.com ; Wed, 29 May 2019 09:59:59 -0700 Received: from svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) by SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 29 May 2019 09:59:56 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) with Microsoft SMTP Server id 15.0.1320.4 via Frontend Transport; Wed, 29 May 2019 09:59:56 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 8D5F0C22DF; Wed, 29 May 2019 09:59:56 -0700 (PDT) From: Thomas Schwinge To: Jakub Jelinek CC: Subject: Re: [gomp] Add langhook, so that Fortran can privatize variables by reference In-Reply-To: <20190527164920.GY19695@tucnak> References: <20051018070140.GB16034@devserv.devel.redhat.com> <87y32tp0wn.fsf@euler.schwinge.homeip.net> <20190527164920.GY19695@tucnak> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Wed, 29 May 2019 17:12:00 -0000 Message-ID: <87d0k1i4cd.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-SW-Source: 2019-05/txt/msg01945.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2263 Hi Jakub! On Mon, 27 May 2019 18:49:20 +0200, Jakub Jelinek wrote: > On Sun, May 26, 2019 at 07:43:04PM +0200, Thomas Schwinge wrote: > > On Tue, 18 Oct 2005 03:01:40 -0400, Jakub Jelinek wr= ote: > > > --- gcc/omp-low.c.jj 2005-10-15 12:00:06.000000000 +0200 > > > +++ gcc/omp-low.c 2005-10-18 08:46:23.000000000 +0200 > > > @@ -126,7 +126,7 @@ is_variable_sized (tree expr) > > > static inline bool > > > is_reference (tree decl) > > > { > > > - return TREE_CODE (TREE_TYPE (decl)) =3D=3D REFERENCE_TYPE; > > > + return lang_hooks.decls.omp_privatize_by_reference (decl); > > > } > >=20 > > With the same implementation, this function nowadays is known as > > 'omp_is_reference' ('gcc/omp-general.c'), and is used in 'omp-*' files > > only. The gimplifier directly calls > > 'lang_hooks.decls.omp_privatize_by_reference'. > >=20 > > Will it be OK to commit the obvious patch to get rid of the > > 'omp_is_reference' function? Whenever I see it used in 'omp-*' files, I >=20 > No, omp_is_reference (something) is certainly more readable from > lang_hooks.decls.omp_privatize_by_reference (something) Yes, better readable because it's shorter, but you have to look up its meaning, whereas with 'lang_hooks.decls.omp_privatize_by_reference' you directly see what it's about. > which is quite > long and would cause major issues in formatting etc. Well, we have rules about how to deal with the formatting issues. > What advantage do you see in removing that? For me, it's confusing, when looking at, say, 'OMP_CLAUSE_FIRSTPRIVATE' code, that in 'gcc/gimplify.c' we call 'lang_hooks.decls.omp_privatize_by_reference', whereas in 'gcc/omp-*.c' files we call 'omp_is_reference' -- but both actually mean the same thing. > > wonder and have to look up what special things it might be doing -- but > > it actually isn't. > >=20 > > gcc/ > > * omp-general.c (omp_is_reference): Don't define. Adjust all u= sers. Or, of course, the other way round: gcc/ * gimplify.c: Use omp_is_reference. Or, even more preferably: gcc/ * omp-general.c (omp_is_reference): Rename to... (omp_privatize_by_reference): ... this. Adjust all users. * gimplify.c: Use it. Gr=C3=BC=C3=9Fe Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 658 -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEU9WEfWKGQazCmycCAKI7+41Q4XkFAlzuuoIACgkQAKI7+41Q 4Xnjsgv9GY75hfC5cCJw6CvDJgu3mUSmcLae9VFNc4QzMBBzuMoZyp/6RAT82IDp NbiJLcASZ0Vh5bX5roayTk7D5MjDVqOD4tgAT2F42gtKG26dJjrc46h4mmqb8qzC nd2z5GLH+YgxY84cVhn5m8pqrdIKG+AwlByQQsGitWPOhqj9+f3Kvrch9skCRFBR 18/NZOu1kHl2Wwly4WFIARKl72VlJwXsxRDeve9Dp0FCNojWFQQtA1v1cWPJinYO FioeuLB+1V+ixGKpNXqMNedFEGBPcwSKMnRGdKCPTCqz4x3bo0FqW630/XSzw9KU 0+LbriXUCnwhdBYSSmykjhhaOlDFVlBUXzGeyt/4lQtvySv42FAKU5FDkVioicfj AETSFfM87Nbr4zsz7eLvZqbqQ177LK9aO8PsXXAo5N17FeW63+904sD0kbs4wEpT uDu2ihhDAsGzalWb7kVS50m1Rk6dMwhxR87tFRmwdbo01gbIby3XVEIQAQP8tSoP 3Ucmi2En =2OdM -----END PGP SIGNATURE----- --=-=-=--