Commit 0a76844b by Tobias Burnus

openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)

gcc/ChangeLog:

	* omp-offload.c (add_decls_addresses_to_decl_constructor,
	omp_finish_file): With in_lto_p, stream out all offload-table
	items even if the symtab_node does not exist.

(cherry picked from commit bf4ab2689bb586971d5b2ab6b13d078cd7ac45af)
parent 9074deee
...@@ -125,7 +125,7 @@ add_decls_addresses_to_decl_constructor (vec<tree, va_gc> *v_decls, ...@@ -125,7 +125,7 @@ add_decls_addresses_to_decl_constructor (vec<tree, va_gc> *v_decls,
&& lookup_attribute ("omp declare target link", DECL_ATTRIBUTES (it)); && lookup_attribute ("omp declare target link", DECL_ATTRIBUTES (it));
/* See also omp_finish_file and output_offload_tables in lto-cgraph.c. */ /* See also omp_finish_file and output_offload_tables in lto-cgraph.c. */
if (!symtab_node::get (it)) if (!in_lto_p && !symtab_node::get (it))
continue; continue;
tree size = NULL_TREE; tree size = NULL_TREE;
...@@ -221,14 +221,14 @@ omp_finish_file (void) ...@@ -221,14 +221,14 @@ omp_finish_file (void)
tree it = (*offload_funcs)[i]; tree it = (*offload_funcs)[i];
/* See also add_decls_addresses_to_decl_constructor /* See also add_decls_addresses_to_decl_constructor
and output_offload_tables in lto-cgraph.c. */ and output_offload_tables in lto-cgraph.c. */
if (!symtab_node::get (it)) if (!in_lto_p && !symtab_node::get (it))
continue; continue;
targetm.record_offload_symbol (it); targetm.record_offload_symbol (it);
} }
for (unsigned i = 0; i < num_vars; i++) for (unsigned i = 0; i < num_vars; i++)
{ {
tree it = (*offload_vars)[i]; tree it = (*offload_vars)[i];
if (!symtab_node::get (it)) if (!in_lto_p && !symtab_node::get (it))
continue; continue;
#ifdef ACCEL_COMPILER #ifdef ACCEL_COMPILER
if (DECL_HAS_VALUE_EXPR_P (it) if (DECL_HAS_VALUE_EXPR_P (it)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment