[gcc(refs/users/marxin/heads/slp-function-v2)] openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)

Martin Liska marxin@gcc.gnu.org
Thu Jun 11 10:07:54 GMT 2020


https://gcc.gnu.org/g:bf4ab2689bb586971d5b2ab6b13d078cd7ac45af

commit bf4ab2689bb586971d5b2ab6b13d078cd7ac45af
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Tue Jun 9 16:31:22 2020 +0200

    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.

Diff:
---
 gcc/omp-offload.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
index 4e44cfc9d0a..32c2485abd4 100644
--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -126,7 +126,7 @@ add_decls_addresses_to_decl_constructor (vec<tree, va_gc> *v_decls,
 	  && lookup_attribute ("omp declare target link", DECL_ATTRIBUTES (it));
 
       /* 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;
 
       tree size = NULL_TREE;
@@ -382,14 +382,14 @@ omp_finish_file (void)
 	  tree it = (*offload_funcs)[i];
 	  /* See also add_decls_addresses_to_decl_constructor
 	     and output_offload_tables in lto-cgraph.c.  */
-	  if (!symtab_node::get (it))
+	  if (!in_lto_p && !symtab_node::get (it))
 	    continue;
 	  targetm.record_offload_symbol (it);
 	}
       for (unsigned i = 0; i < num_vars; i++)
 	{
 	  tree it = (*offload_vars)[i];
-	  if (!symtab_node::get (it))
+	  if (!in_lto_p && !symtab_node::get (it))
 	    continue;
 #ifdef ACCEL_COMPILER
 	  if (DECL_HAS_VALUE_EXPR_P (it)


More information about the Gcc-cvs mailing list