From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110701 invoked by alias); 1 Dec 2015 08:30:17 -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 110686 invoked by uid 89); 1 Dec 2015 08:30:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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, 01 Dec 2015 08:30:15 +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 CBBFD71; Tue, 1 Dec 2015 08:30:13 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB18UBfi032119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 1 Dec 2015 03:30:13 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id tB18UAvG012440; Tue, 1 Dec 2015 09:30:10 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id tB18U8v8012439; Tue, 1 Dec 2015 09:30:08 +0100 Date: Tue, 01 Dec 2015 08:30:00 -0000 From: Jakub Jelinek To: Julian Brown Cc: James Norris , GCC Patches , "Joseph S. Myers" , Nathan Sidwell Subject: Re: [OpenACC 0/7] host_data construct Message-ID: <20151201083008.GO5675@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <56293476.5020801@codesourcery.com> <562A578E.4080907@codesourcery.com> <20151026183422.GW478@tucnak.redhat.com> <20151102183339.365c3d33@octopus> <20151112111621.657650bc@octopus> <20151118124747.30a2ec5d@octopus> <20151119131345.GX5675@tucnak.redhat.com> <20151119142650.5a8842e4@octopus> <20151119155723.GA5675@tucnak.redhat.com> <20151130193034.71143aa4@octopus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151130193034.71143aa4@octopus> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00041.txt.bz2 On Mon, Nov 30, 2015 at 07:30:34PM +0000, Julian Brown wrote: > Julian Brown > Cesar Philippidis > James Norris > > gcc/ > * c-family/c-pragma.c (oacc_pragmas): Add PRAGMA_OACC_HOST_DATA. > * c-family/c-pragma.h (pragma_kind): Add PRAGMA_OACC_HOST_DATA. c-family/, c/ and cp/ subdirectories have their own ChangeLog, so you need to split the entry into multiple ChangeLog files and remove the directory prefixes. > @@ -6120,6 +6121,9 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) > (splay_tree_key) decl); > if (n2) > { > + if (octx->region_type == ORT_ACC_HOST_DATA) > + error ("variable %qE declared in enclosing " > + "host_data region", DECL_NAME (decl)); % instead? > nflags |= GOVD_MAP; > goto found_outer; > } > @@ -6418,6 +6422,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, > case OMP_TARGET_DATA: > case OMP_TARGET_ENTER_DATA: > case OMP_TARGET_EXIT_DATA: > + case OACC_HOST_DATA: > ctx->target_firstprivatize_array_bases = true; > default: > break; > @@ -6683,6 +6688,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, > case OMP_TARGET_DATA: > case OMP_TARGET_ENTER_DATA: > case OMP_TARGET_EXIT_DATA: > + case OACC_HOST_DATA: > if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER > || (OMP_CLAUSE_MAP_KIND (c) > == GOMP_MAP_FIRSTPRIVATE_REFERENCE)) > @@ -6695,6 +6701,22 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, > } > if (remove) > break; > + if (DECL_P (decl) && outer_ctx && (region_type & ORT_ACC)) > + { > + struct gimplify_omp_ctx *octx; > + for (octx = outer_ctx; octx; octx = octx->outer_context) > + { > + if (!(octx->region_type & (ORT_TARGET_DATA | ORT_TARGET))) > + break; Wouldn't it be better to do if (octx->region_type != ORT_ACC_HOST_DATA) continue; here, thus only lookup if you really want to use it? > + splay_tree_node n2 > + = splay_tree_lookup (octx->variables, > + (splay_tree_key) decl); > + if (n2 && octx->region_type == ORT_ACC_HOST_DATA) and remove the && ... part from the condition? > + error_at (OMP_CLAUSE_LOCATION (c), "variable %qE " > + "declared in enclosing host_data region", > + DECL_NAME (decl)); > + } > + } > if (OMP_CLAUSE_SIZE (c) == NULL_TREE) > OMP_CLAUSE_SIZE (c) = DECL_P (decl) ? DECL_SIZE_UNIT (decl) > : TYPE_SIZE_UNIT (TREE_TYPE (decl)); Ok with those changes. Jakub