From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91632 invoked by alias); 6 Nov 2015 19:45:19 -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 91623 invoked by uid 89); 6 Nov 2015 19:45:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 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; Fri, 06 Nov 2015 19:45:17 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Zumwh-00023O-8m from James_Norris@mentor.com ; Fri, 06 Nov 2015 11:45:11 -0800 Received: from [172.30.80.115] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.224.2; Fri, 6 Nov 2015 11:45:10 -0800 Message-ID: <563D0345.7010208@codesourcery.com> Date: Fri, 06 Nov 2015 19:45:00 -0000 From: James Norris User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jakub Jelinek CC: GCC Patches Subject: Re: OpenACC declare directive updates References: <5637692F.7050306@codesourcery.com> <5639FAC0.2090104@codesourcery.com> <20151106193127.GI5675@tucnak.redhat.com> In-Reply-To: <20151106193127.GI5675@tucnak.redhat.com> X-TagToolbar-Keys: D20151106134509028 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00719.txt.bz2 Jakub, On 11/06/2015 01:31 PM, Jakub Jelinek wrote: > On Wed, Nov 04, 2015 at 06:32:00AM -0600, James Norris wrote: >> +/* Node in the linked list used for storing !$oacc declare constructs. */ >> + >> +typedef struct gfc_oacc_declare >> +{ >> + struct gfc_oacc_declare *next; >> + bool module_var; >> + gfc_omp_clauses *clauses; >> + gfc_omp_clauses *return_clauses; >> +} >> +gfc_oacc_declare; >> + >> +#define gfc_get_oacc_declare() XCNEW (gfc_oacc_declare) >> + >> + >> /* Node in the linked list used for storing !$omp declare simd constructs. */ >> >> typedef struct gfc_omp_declare_simd >> @@ -1644,7 +1668,7 @@ typedef struct gfc_namespace >> struct gfc_data *data, *old_data; >> >> /* !$ACC DECLARE clauses. */ >> - gfc_omp_clauses *oacc_declare_clauses; >> + struct gfc_oacc_declare *oacc_declare_clauses; > This should be renamed now that it doesn't hold just clauses, > perhaps just oacc_declare? Also, no need to use struct keyword. That's fine, I'll fix that. > >> @@ -2857,6 +2957,42 @@ oacc_compatible_clauses (gfc_omp_clauses *clauses, int list, >> return false; >> } >> >> +/* Check if a variable appears in multiple clauses. */ >> + >> +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"; >> + >> + /* OpenACC reduction clauses are compatible with everything. We only >> + need to check if a reduction variable is used more than once. */ >> + if (openacc && list == OMP_LIST_REDUCTION) >> + { >> + hash_set reductions; >> + >> + for (n = clause_list; n; n = n->next) >> + { >> + if (reductions.contains (n->sym)) >> + gfc_error (error_msg, n->sym->name, &n->expr->where); >> + else >> + reductions.add (n->sym); >> + } >> + >> + return; >> + } >> + >> + /* Ensure that variables are only used in one clause. */ >> + for (n = clause_list; n; n = n->next) >> + { >> + if (n->sym->mark) >> + gfc_error (error_msg, n->sym->name, &n->expr->where); >> + else >> + n->sym->mark = 1; >> + } >> +} > You are readding a function that has been rejected, OMP_LIST_REDUCTION > is handled differently now. > > Jakub Okay, I'll fix this. After fixing, OK to commit? Thank you for taking the time for the review. Jim