From: vries Date: Thu, 14 Jan 2016 20:01:39 +0000 (+0000) Subject: Mark symbols in offload tables with force_output in read_offload_tables X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c39e3a534b3071dda9130f05ef6db5106821490;p=thirdparty%2Fgcc.git Mark symbols in offload tables with force_output in read_offload_tables 2016-01-14 Tom de Vries 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232384 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35e39b57501a..d7eabaf652fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-01-14 Tom de Vries + + 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 PR debug/69244 diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 3f40b03bc2f7..d11a822b217d 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-01-14 Tom de Vries + + 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 PR c/69262 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index a0e0052156c6..919680aab47c 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -13599,10 +13599,7 @@ c_parser_oacc_declare (c_parser *parser) { g->have_offload = true; if (is_a (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 (node)) - { - vec_safe_push (offload_vars, t); - node->force_output = 1; - } + vec_safe_push (offload_vars, t); } } } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 54db540da57c..92925a3ecb02 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-01-14 Tom de Vries + + 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 PR c++/69261 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 13ed1ef0c53c..f2d49a1bbde9 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -35164,10 +35164,7 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok) { g->have_offload = true; if (is_a (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 (node)) - { - vec_safe_push (offload_vars, t); - node->force_output = 1; - } + vec_safe_push (offload_vars, t); } } } diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 82eda7e19e93..063477920a08 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -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, diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 9dda946f99f0..6df01a476e1e 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -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. diff --git a/gcc/varpool.c b/gcc/varpool.c index 4654459cf8e8..d88343cdc091 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -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; } }