https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119692

--- Comment #3 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Jakub, could you please quickly describe the approach you'd take to get the
relevant 'DECL_TINFO_P' and 'DECL_VTABLE_OR_VTT_P' (correct, and complete list
of predicates?) into 'offload_vars' (via the usual 'symtab_node::get', 'omp
declare target' attribute etc. thing, I assume)?  ..., but I suppose only those
'typeinfo', 'vtable' that are actually used in offloaded regions, or do (we
have to?) simply do it for all of them?

For example, in 'gcc/cp/decl.cc:cp_finish_decl', I wouldn't necessarily already
know whether used in offloading region?  Ah, or do I tag all of them 'omp
declare target implicit', and then just let 'cp_finish_decl' do its thing?

Or, transform the 'gcc/gimplify.cc:gimplify_bind_expr' handling of "Static
locals inside of target construct" into a langhook, and extend for
'DECL_TINFO_P' and 'DECL_VTABLE_OR_VTT_P'?

Or, do we have to do à la
'gcc/omp-offload.cc:omp_discover_implicit_declare_target',
'omp_discover_declare_target_var_r'?

Also, have to make sure that we don't synthesize any 'map' clauses for
'DECL_TINFO_P' and 'DECL_VTABLE_OR_VTT_P'; in
'gcc/gimplify.cc:omp_notice_variable', need to achieve 'is_declare_target ==
true'.  (..., and in 'omp_predetermined_mapping' langhook, 'assert' we don't
see these variables?)

Reply via email to