This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "omp declare target" on DECL_EXTERNAL vars


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]