On Fri, Oct 30, 2015 at 08:44:07PM +0300, Ilya Verbin wrote: > On Wed, Oct 28, 2015 at 00:11:03 +0300, Ilya Verbin wrote: > > On Fri, Jul 17, 2015 at 15:05:59 +0200, Jakub Jelinek wrote: > > > As the testcases show, #pragma omp declare target has now a new form > > > (well, > > > two; with some issues on it pending), where it is used just as a single > > > declarative directive rather than a pair of them and allows marking > > > vars and functions by name as "omp declare target" vars/functions (which > > > the > > > middle-end etc. already handles), > > > > There is an issue - such variables are not added to the offloading tables, > > because when varpool_node::get_create is called for the first time, the > > variable > > doesn't yet have "omp declare target" attribute, and when it's called for > > the > > second time, it just returns existing node. Functions also aren't marked as > > offloadable. I tried to fix this by moving the code from > > varpool_node::get_create to varpool_node::finalize_decl, but it helped only > > C, > > but doesn't fix C++. Therefore, I decided to iterate through all functions > > and > > variables, like in the patch bellow. But it doesn't work for static vars, > > declared inside functions, because they do not appear in symtab :( > > Ping? Where should I set node->offloadable for "omp declare target to (list)" > functions, global and static vars?
Perhaps already somewhere in the FEs? I mean, when the varpool node is created after the decl has that attribute, it already should set offsetable itself, so perhaps when adding the attribute check if corresponding varpool node exists already (but don't create it) and if yes, set offloadable? Jakub