diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-06-08 23:24:57 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-06-08 23:24:57 +0200 |
commit | 1c0fdaf79e3618fd7512608a2e5c62b6b306e9e8 (patch) | |
tree | 40801185b32a7952f90cf1d11b9e664ccf29eeff /gcc/lto-cgraph.c | |
parent | ffac9597256823612fb63bbab0f9ba3c11255e6b (diff) | |
download | gcc-1c0fdaf79e3618fd7512608a2e5c62b6b306e9e8.zip gcc-1c0fdaf79e3618fd7512608a2e5c62b6b306e9e8.tar.gz gcc-1c0fdaf79e3618fd7512608a2e5c62b6b306e9e8.tar.bz2 |
openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)
gcc/ChangeLog:
PR lto/94848
PR middle-end/95551
* omp-offload.c (add_decls_addresses_to_decl_constructor,
omp_finish_file): Skip removed items.
* lto-cgraph.c (output_offload_tables): Likewise; set force_output
to this node for variables and functions.
libgomp/ChangeLog:
PR lto/94848
PR middle-end/95551
* testsuite/libgomp.fortran/target-var.f90: New test.
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index a671c67..93a99f3 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -1069,6 +1069,10 @@ output_offload_tables (void) for (unsigned i = 0; i < vec_safe_length (offload_funcs); i++) { + symtab_node *node = symtab_node::get ((*offload_funcs)[i]); + if (!node) + continue; + node->force_output = true; streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag, LTO_symtab_unavail_node); lto_output_fn_decl_ref (ob->decl_state, ob->main_stream, @@ -1077,6 +1081,10 @@ output_offload_tables (void) for (unsigned i = 0; i < vec_safe_length (offload_vars); i++) { + symtab_node *node = symtab_node::get ((*offload_vars)[i]); + if (!node) + continue; + node->force_output = true; streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag, LTO_symtab_variable); lto_output_var_decl_ref (ob->decl_state, ob->main_stream, |