From: Tom de Vries Date: Mon, 15 Feb 2016 09:30:31 +0000 (+0000) Subject: Don't mark offload symbols with force_output in ltrans X-Git-Tag: basepoints/gcc-7~948 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed5d948da920f8de6041b7010625cfeff7014203;p=thirdparty%2Fgcc.git Don't mark offload symbols with force_output in ltrans 2016-02-15 Tom de Vries PR lto/69655 * lto-cgraph.c (input_offload_tables): Add and handle bool parameter do_force_output. * lto-streamer.h (input_offload_tables): Add and handle bool parameter. * lto.c (read_cgraph_and_symbols): Call input_offload_tables with argument. From-SVN: r233419 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 565b50598c49..59be0fdd6857 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-02-15 Tom de Vries + + PR lto/69655 + * lto-cgraph.c (input_offload_tables): Add and handle bool parameter + do_force_output. + * lto-streamer.h (input_offload_tables): Add and handle bool parameter. + 2016-02-15 Richard Biener PR tree-optimization/69776 diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 063477920a08..95c446d0696e 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -1885,7 +1885,7 @@ input_symtab (void) target code, and store them into OFFLOAD_FUNCS and OFFLOAD_VARS. */ void -input_offload_tables (void) +input_offload_tables (bool do_force_output) { struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data (); struct lto_file_decl_data *file_data; @@ -1915,7 +1915,8 @@ input_offload_tables (void) /* 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 (); + if (do_force_output) + cgraph_node::get (fn_decl)->mark_force_output (); } else if (tag == LTO_symtab_variable) { @@ -1926,7 +1927,8 @@ input_offload_tables (void) /* 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; + if (do_force_output) + varpool_node::get (var_decl)->force_output = 1; } else fatal_error (input_location, diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 0cb200e2d3fe..f3911613b074 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -915,7 +915,7 @@ bool lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t, void output_symtab (void); void input_symtab (void); void output_offload_tables (void); -void input_offload_tables (void); +void input_offload_tables (bool); bool referenced_from_other_partition_p (struct ipa_ref_list *, lto_symtab_encoder_t); bool reachable_from_other_partition_p (struct cgraph_node *, diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 43faaf4cb303..6496fd900a79 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2016-02-15 Tom de Vries + + PR lto/69655 + * lto.c (read_cgraph_and_symbols): Call input_offload_tables with + argument. + 2016-01-27 Martin Liska * lto-partition.c (add_symbol_to_partition_1): Remove usage diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 6718fbbe984a..9dd513fef866 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2855,7 +2855,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) /* Read the symtab. */ input_symtab (); - input_offload_tables (); + input_offload_tables (!flag_ltrans); /* Store resolutions into the symbol table. */