From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111894 invoked by alias); 30 Oct 2015 14:47:36 -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 111872 invoked by uid 89); 30 Oct 2015 14:47:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 30 Oct 2015 14:47:34 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 975178E259; Fri, 30 Oct 2015 14:47:33 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-121.ams2.redhat.com [10.36.116.121]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9UElWVT013954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 30 Oct 2015 10:47:33 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id t9UElUBf023388; Fri, 30 Oct 2015 15:47:30 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id t9UElRHk023387; Fri, 30 Oct 2015 15:47:27 +0100 Date: Fri, 30 Oct 2015 14:47:00 -0000 From: Jakub Jelinek To: Cesar Philippidis Cc: Fortran List , "gcc-patches@gcc.gnu.org" Subject: Re: more accurate omp in fortran Message-ID: <20151030144727.GC478@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <5628FEFF.50809@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5628FEFF.50809@codesourcery.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00181.txt.bz2 On Thu, Oct 22, 2015 at 08:21:35AM -0700, Cesar Philippidis wrote: > diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h > index b2894cc..93adb7b 100644 > --- a/gcc/fortran/gfortran.h > +++ b/gcc/fortran/gfortran.h > @@ -1123,6 +1123,7 @@ typedef struct gfc_omp_namelist > } u; > struct gfc_omp_namelist_udr *udr; > struct gfc_omp_namelist *next; > + locus where; > } > gfc_omp_namelist; > > diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c > index 3c12d8e..56a95d4 100644 > --- a/gcc/fortran/openmp.c > +++ b/gcc/fortran/openmp.c > @@ -244,6 +244,7 @@ gfc_match_omp_variable_list (const char *str, gfc_omp_namelist **list, > } > tail->sym = sym; > tail->expr = expr; > + tail->where = cur_loc; > goto next_item; > case MATCH_NO: > break; > @@ -278,6 +279,7 @@ gfc_match_omp_variable_list (const char *str, gfc_omp_namelist **list, > tail = tail->next; > } > tail->sym = sym; > + tail->where = cur_loc; > } > > next_item: The above is fine. > @@ -2832,36 +2834,47 @@ resolve_omp_udr_clause (gfc_omp_namelist *n, gfc_namespace *ns, > return copy; > } > > -/* Returns true if clause in list 'list' is compatible with any of > - of the clauses in lists [0..list-1]. E.g., a reduction variable may > - appear in both reduction and private clauses, so this function > - will return true in this case. */ > +/* Check if a variable appears in multiple clauses. */ > > -static bool > -oacc_compatible_clauses (gfc_omp_clauses *clauses, int list, > - gfc_symbol *sym, bool openacc) > +static void > +resolve_omp_duplicate_list (gfc_omp_namelist *clause_list, bool openacc, > + int list) > { > gfc_omp_namelist *n; > + const char *error_msg = "Symbol %qs present on multiple clauses at %L"; Please don't do this, I'm afraid this breaks translations. Also, can you explain why all the mess with OMP_LIST_REDUCTION && openacc? That clearly looks misplaced to me. If one list item may be in at most one reduction clause, but may be in any other clause too, then it is the same case as e.g. OpenMP OMP_LIST_ALIGNED case, so you should instead just: && (list != OMP_LIST_REDUCTION || !openacc) to the for (list = 0; list < OMP_LIST_NUM; list++) loop, and handle OMP_LIST_REDUCTION specially, similarly how OMP_LIST_ALIGNED is handled, just guarded with if (openacc). Jakub