From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10996 invoked by alias); 12 Jul 2019 11:41:30 -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 10981 invoked by uid 89); 12 Jul 2019 11:41:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=wtih, 13pm, 13PM X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jul 2019 11:41:28 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 935C43091851; Fri, 12 Jul 2019 11:41:27 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-236.ams2.redhat.com [10.36.116.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 394AE19C4F; Fri, 12 Jul 2019 11:41:27 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x6CBfP3O015370; Fri, 12 Jul 2019 13:41:25 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x6CBfMG3015369; Fri, 12 Jul 2019 13:41:22 +0200 Date: Fri, 12 Jul 2019 11:42:00 -0000 From: Jakub Jelinek To: Kwok Cheung Yeung Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, thomas@codesourcery.com Subject: Re: [PATCH 2/5, OpenACC] Support Fortran optional arguments in the firstprivate clause Message-ID: <20190712114122.GA2125@tucnak> Reply-To: Jakub Jelinek References: <6aaaeec8-9c6d-9293-5b6c-622d9fcf2664@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00967.txt.bz2 On Fri, Jul 12, 2019 at 12:36:13PM +0100, Kwok Cheung Yeung wrote: > --- a/gcc/omp-general.c > +++ b/gcc/omp-general.c > @@ -48,6 +48,20 @@ omp_find_clause (tree clauses, enum omp_clause_code kind) > return NULL_TREE; > } > > +/* Return true if DECL is a Fortran optional argument. */ > + > +bool > +omp_is_optional_argument (tree decl) > +{ > + /* A passed-by-reference Fortran optional argument is similar to > + a normal argument, but since it can be null the type is a > + POINTER_TYPE rather than a REFERENCE_TYPE. */ > + return lang_GNU_Fortran () > + && TREE_CODE (decl) == PARM_DECL > + && DECL_BY_REFERENCE (decl) > + && TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE; > +} This should be done through a langhook. Are really all PARM_DECLs wtih DECL_BY_REFERENCE and pointer type optional arguments? I mean, POINTER_TYPE is used for a lot of cases. Jakub