Re: "omp declare target" on DECL_EXTERNAL vars

2016-05-23 Thread Jakub Jelinek
On Mon, May 23, 2016 at 09:19:47PM +0300, Alexander Monakov wrote: > > So unlike for functions, for variables GCC needs to know exactly whether they > are 'omp declare target [link]' at all points of use, not just at the point of > definition. There are many bugs that just can't be diagnosed by t

Re: "omp declare target" on DECL_EXTERNAL vars

2016-05-23 Thread Alexander Monakov
On Mon, 23 May 2016, Jakub Jelinek wrote: > Having the externs specified in omp declare target to is important for > code generation, we need to know that whether the vars should be mapped > implicitly on target constructs and remapped in the target construct bodies, > or whether the actual vars sh

Re: "omp declare target" on DECL_EXTERNAL vars

2016-05-23 Thread Jakub Jelinek
On Mon, May 23, 2016 at 07:15:48PM +0300, Alexander Monakov wrote: > (it's unclear to me what you mean by 'non-local vars' here, from the context > it looks like it's 'variables with an external declaration and no definition > in the current TU'; correct?) Sure. > Looking at the OpenMP 4.5 spec,

Re: "omp declare target" on DECL_EXTERNAL vars

2016-05-23 Thread Alexander Monakov
On Fri, 20 May 2016, Jakub Jelinek wrote: > but that made me think on what handling do we want for the > "omp declare target" DECL_EXTERNAL vars. [snip] > 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 > me

Re: "omp declare target" on DECL_EXTERNAL vars

2016-05-23 Thread Jakub Jelinek
On Mon, May 23, 2016 at 05:37:17PM +0300, Alexander Monakov wrote: > 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

Re: "omp declare target" on DECL_EXTERNAL vars

2016-05-23 Thread Alexander Monakov
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

"omp declare target" on DECL_EXTERNAL vars

2016-05-20 Thread Jakub Jelinek
Hi! While working on this patch, I've noticed the need to do: On Fri, May 20, 2016 at 06:12:44PM +0200, Jakub Jelinek wrote: > * varpool.c (varpool_node::get_create): Set node->offloading > even for DECL_EXTERNAL decls. ... > --- gcc/varpool.c.jj 2016-05-04 18:43:25.0 +0200 >