From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89340 invoked by alias); 24 May 2016 06:10:06 -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 89231 invoked by uid 89); 24 May 2016 06:10:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=surprise 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; Tue, 24 May 2016 06:10:03 +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 49974C04D292; Tue, 24 May 2016 06:10:02 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-88.ams2.redhat.com [10.36.116.88]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4O6A0NW024321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 24 May 2016 02:10:01 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u4O69w3Z014358; Tue, 24 May 2016 08:09:58 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u4O69tfN014357; Tue, 24 May 2016 08:09:55 +0200 Date: Tue, 24 May 2016 06:10:00 -0000 From: Jakub Jelinek To: Cesar Philippidis Cc: "gcc-patches@gcc.gnu.org" Subject: Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++ Message-ID: <20160524060955.GB28550@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <573244BE.5010708@codesourcery.com> <20160520094231.GF28550@tucnak.redhat.com> <5743BD19.4090708@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5743BD19.4090708@codesourcery.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01853.txt.bz2 On Mon, May 23, 2016 at 07:31:53PM -0700, Cesar Philippidis wrote: > @@ -12559,7 +12560,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) > t = OMP_CLAUSE_DECL (c); > if (TREE_CODE (t) == TREE_LIST) > { > - if (handle_omp_array_sections (c, ort & C_ORT_OMP)) > + if (handle_omp_array_sections (c, ort & (C_ORT_OMP | C_ORT_ACC))) > { > remove = true; > break; You haven't touched the /c/ handle_omp_array_sections{,_1}. As I said, I believe you can just drop the is_omp argument altogether (unlike C++), or, pass for consistency ort itself there as well. But I bet the argument will be unused. > --- a/gcc/cp/semantics.c > +++ b/gcc/cp/semantics.c > @@ -4472,7 +4472,7 @@ omp_privatize_field (tree t, bool shared) > static tree > handle_omp_array_sections_1 (tree c, tree t, vec &types, > bool &maybe_zero_len, unsigned int &first_non_one, > - bool is_omp) > + enum c_omp_region_type ort) > { > tree ret, low_bound, length, type; > if (TREE_CODE (t) != TREE_LIST) > @@ -4484,7 +4484,7 @@ handle_omp_array_sections_1 (tree c, tree t, vec &types, > t = TREE_OPERAND (t, 0); > ret = t; > if (TREE_CODE (t) == COMPONENT_REF > - && is_omp > + && ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP || ort == C_ORT_ACC) > && (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP > || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TO > || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM) This hunk looks wrong, I'd expect just && ort == C_ORT_OMP. OpenACC to my knowledge doesn't have mapping of fields, at least you reject copy(var.field) so it would surprise me if you wanted to allow copy(var.field[:]). And #pragma omp declare simd doesn't have any clauses for which it would call handle_omp_array_sections* at all. > @@ -4545,11 +4545,12 @@ handle_omp_array_sections_1 (tree c, tree t, vec &types, > return ret; > } > > - if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION > + if ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP > + && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION ort == C_ORT_OMP is enough. > @@ -4988,7 +4989,7 @@ handle_omp_array_sections (tree c, bool is_omp) > || (TREE_CODE (t) == COMPONENT_REF > && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)) > return false; > - if (is_omp) > + if ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP || ort == C_ORT_ACC) if (ort == C_ORT_OMP || ort == C_ORT_ACC) Jakub