diff options
author | Tom de Vries <tom@codesourcery.com> | 2016-01-14 20:01:39 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2016-01-14 20:01:39 +0000 |
commit | e6d6ec9e06d6512732941c86464d8c5852928432 (patch) | |
tree | d7d7471f673a927626b21db4007d16bcf4e89625 | |
parent | c3f6914aa4a8e592957c1e518c31fe27c1b208ac (diff) | |
download | gcc-e6d6ec9e06d6512732941c86464d8c5852928432.zip gcc-e6d6ec9e06d6512732941c86464d8c5852928432.tar.gz gcc-e6d6ec9e06d6512732941c86464d8c5852928432.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 10 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 10 | ||||
-rw-r--r-- | gcc/lto-cgraph.c | 9 | ||||
-rw-r--r-- | gcc/omp-low.c | 5 | ||||
-rw-r--r-- | gcc/varpool.c | 1 |
8 files changed, 33 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35e39b5..d7eabaf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 3f40b03..d11a822 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -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 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index a0e0052..919680a 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 <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); } } } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 54db540..92925a3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 13ed1ef..f2d49a1 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 <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); } } } diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 82eda7e..0634779 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 9dda946..6df01a4 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 4654459..d88343c 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; } } |