Mark symbols in offload tables with force_output in read_offload_tables

2016-01-14  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/68773
	* c-parser.c (c_parser_oacc_declare, c_parser_omp_declare_target): Don't
	set force_output.

	* parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
	set force_output.

	* omp-low.c (expand_omp_target): Don't set force_output.
	* varpool.c (varpool_node::get_create): Same.
	* lto-cgraph.c (input_offload_tables): Mark entries in offload_vars and
	offload_funcs with force_output.

From-SVN: r232384
This commit is contained in:
Tom de Vries 2016-01-14 20:01:39 +00:00 committed by Tom de Vries
parent c3f6914aa4
commit e6d6ec9e06
8 changed files with 33 additions and 22 deletions

View File

@ -1,3 +1,11 @@
2016-01-14 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68773
* omp-low.c (expand_omp_target): Don't set force_output.
* varpool.c (varpool_node::get_create): Same.
* lto-cgraph.c (input_offload_tables): Mark entries in offload_vars and
offload_funcs with force_output.
2016-01-14 Jakub Jelinek <jakub@redhat.com>
PR debug/69244

View File

@ -1,3 +1,9 @@
2016-01-14 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68773
* c-parser.c (c_parser_oacc_declare, c_parser_omp_declare_target): Don't
set force_output.
2016-01-14 Marek Polacek <polacek@redhat.com>
PR c/69262

View File

@ -13599,10 +13599,7 @@ c_parser_oacc_declare (c_parser *parser)
{
g->have_offload = true;
if (is_a <varpool_node *> (node))
{
vec_safe_push (offload_vars, decl);
node->force_output = 1;
}
vec_safe_push (offload_vars, decl);
}
}
}
@ -16484,10 +16481,7 @@ c_parser_omp_declare_target (c_parser *parser)
{
g->have_offload = true;
if (is_a <varpool_node *> (node))
{
vec_safe_push (offload_vars, t);
node->force_output = 1;
}
vec_safe_push (offload_vars, t);
}
}
}

View File

@ -1,3 +1,9 @@
2016-01-14 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68773
* parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
set force_output.
2016-01-14 Jason Merrill <jason@redhat.com>
PR c++/69261

View File

@ -35164,10 +35164,7 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok)
{
g->have_offload = true;
if (is_a <varpool_node *> (node))
{
vec_safe_push (offload_vars, decl);
node->force_output = 1;
}
vec_safe_push (offload_vars, decl);
}
}
}
@ -35704,10 +35701,7 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok)
{
g->have_offload = true;
if (is_a <varpool_node *> (node))
{
vec_safe_push (offload_vars, t);
node->force_output = 1;
}
vec_safe_push (offload_vars, t);
}
}
}

View File

@ -1911,6 +1911,11 @@ input_offload_tables (void)
tree fn_decl
= lto_file_decl_data_get_fn_decl (file_data, decl_index);
vec_safe_push (offload_funcs, fn_decl);
/* Prevent IPA from removing fn_decl as unreachable, since there
may be no refs from the parent function to child_fn in offload
LTO mode. */
cgraph_node::get (fn_decl)->mark_force_output ();
}
else if (tag == LTO_symtab_variable)
{
@ -1918,6 +1923,10 @@ input_offload_tables (void)
tree var_decl
= lto_file_decl_data_get_var_decl (file_data, decl_index);
vec_safe_push (offload_vars, var_decl);
/* Prevent IPA from removing var_decl as unused, since there
may be no refs to var_decl in offload LTO mode. */
varpool_node::get (var_decl)->force_output = 1;
}
else
fatal_error (input_location,

View File

@ -12771,11 +12771,6 @@ expand_omp_target (struct omp_region *region)
assign_assembler_name_if_neeeded (child_fn);
cgraph_edge::rebuild_edges ();
/* Prevent IPA from removing child_fn as unreachable, since there are no
refs from the parent function to child_fn in offload LTO mode. */
if (ENABLE_OFFLOADING)
cgraph_node::get (child_fn)->mark_force_output ();
/* Some EH regions might become dead, see PR34608. If
pass_cleanup_cfg isn't the first pass to happen with the
new child, these dead EH edges might cause problems.

View File

@ -158,7 +158,6 @@ varpool_node::get_create (tree decl)
g->have_offload = true;
if (!in_lto_p)
vec_safe_push (offload_vars, decl);
node->force_output = 1;
}
}