From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121520 invoked by alias); 27 Jan 2017 15:07:38 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 121433 invoked by uid 89); 27 Jan 2017 15:07:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:1415, H*i:sk:ac10bd9, H*f:sk:ac10bd9, H*MI:sk:ac10bd9 X-Spam-User: qpsmtpd, 2 recipients 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, 27 Jan 2017 15:07:25 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53469C05B1D4; Fri, 27 Jan 2017 15:07:25 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-185.ams2.redhat.com [10.36.117.185]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0RF7Nqr017979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Jan 2017 10:07:24 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v0RF7LHk010366; Fri, 27 Jan 2017 16:07:21 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v0RF7JZ5010365; Fri, 27 Jan 2017 16:07:19 +0100 Date: Fri, 27 Jan 2017 15:07:00 -0000 From: Jakub Jelinek To: Cesar Philippidis Cc: "gcc-patches@gcc.gnu.org" , Fortran List Subject: Re: [gomp4] don't error on implicitly private induction variables in gfortran Message-ID: <20170127150719.GV1867@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2017-01/txt/msg00099.txt.bz2 On Fri, Jan 27, 2017 at 07:02:45AM -0800, Cesar Philippidis wrote: > While experimenting with some new OpenACC benchmarks, I noticed that > gfortran errors when the user explicitly marks loop induction variables > as private. I applied this patch to gomp-4_0-branch to resolve that problem. > > Cesar > 2017-01-26 Cesar Philippidis > > gcc/fortran/ > * openmp.c (gfc_resolve_oacc_blocks): Populate list of private > variables. > > gcc/testsuite/ > * gfortran.dg/goacc/implicitly-private.f90: New test. > > > diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c > index 61940d7..2782a8d 100644 > --- a/gcc/fortran/openmp.c > +++ b/gcc/fortran/openmp.c > @@ -5192,7 +5192,8 @@ gfc_resolve_oacc_blocks (gfc_code *code, gfc_namespace *ns) > { > fortran_omp_context ctx; > oacc_function dims = OACC_FUNCTION_NONE; > - > + gfc_omp_namelist *n; > + > resolve_oacc_loop_blocks (code); > > ctx.code = code; > @@ -5217,6 +5218,10 @@ gfc_resolve_oacc_blocks (gfc_code *code, gfc_namespace *ns) > ctx.dims = dims; > omp_current_ctx = &ctx; > > + if (code->ext.omp_clauses) > + for (n = code->ext.omp_clauses->lists[OMP_LIST_PRIVATE]; n; n = n->next) > + ctx.private_iterators->add (n->sym); Do you really want to add to private_iterators even variables that aren't iterators, just arbitrary private variable? Jakub