From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85566 invoked by alias); 23 May 2016 14:37:24 -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 85553 invoked by uid 89); 23 May 2016 14:37:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=symtab_node, alexander, Alexander, watch X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 May 2016 14:37:21 +0000 Received: from [10.10.3.121] (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id 8A804203FB; Mon, 23 May 2016 17:37:17 +0300 (MSK) Date: Mon, 23 May 2016 14:37:00 -0000 From: Alexander Monakov To: Jakub Jelinek cc: Ilya Verbin , Nathan Sidwell , Thomas Schwinge , Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: "omp declare target" on DECL_EXTERNAL vars In-Reply-To: <20160520162120.GO28550@tucnak.redhat.com> Message-ID: References: <20160520161244.GN28550@tucnak.redhat.com> <20160520162120.GO28550@tucnak.redhat.com> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2016-05/txt/msg01807.txt.bz2 Hello, On Fri, 20 May 2016, Jakub Jelinek wrote: [snip] > The reason I needed the above is that both gimplify.c and omp-low.c > test just the node->offloadable flag, bit the attribute, and so when > it is external and the flag wasn't set, we could privatize the vars > even when we were supposed to map them etc. > In the C/C++ FEs, we set not just node->offloadable, but also > for ENABLE_OFFLOADING g->have_offload and offload_vars too. > Wonder if that means we register even non-local vars, that would be IMHO a > bug. On the other side, we need to watch for an extern declaration > of a VAR_DECL marked for offloading and only later on locally defined, > in that case if we haven't set g->have_offload and added entry to > offload_vars, we'd need to do it when merging the extern decl with the > definition. > > So, your thoughts on that? As I'm relatively late to this game, at times like this it's hard for me to follow what's the general model is. It appears that 'omp declare target' is superfluous given symtab_node::offloadable. Offloading compilation still needs to distinguish target region entry points from the rest of the functions (hence 'omp target entrypoint' serves a clear purpose), but does plain 'omp declare target' have a particular meaning not conveyed by symtab_node::offloadable && !'omp target entrypoint'? Is/should be there an invariant like "when omp-low is completed, all decls annotated with 'omp declare target' will also have symtab_node::offloadable set"? Thanks. Alexander