Commit ed5d948d by Tom de Vries Committed by Tom de Vries

Don't mark offload symbols with force_output in ltrans

2016-02-15  Tom de Vries  <tom@codesourcery.com>

	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
parent 1c48bff1
2016-02-15 Tom de Vries <tom@codesourcery.com>
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 <rguenther@suse.de> 2016-02-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/69776 PR tree-optimization/69776
......
...@@ -1885,7 +1885,7 @@ input_symtab (void) ...@@ -1885,7 +1885,7 @@ input_symtab (void)
target code, and store them into OFFLOAD_FUNCS and OFFLOAD_VARS. */ target code, and store them into OFFLOAD_FUNCS and OFFLOAD_VARS. */
void 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_vec = lto_get_file_decl_data ();
struct lto_file_decl_data *file_data; struct lto_file_decl_data *file_data;
...@@ -1915,7 +1915,8 @@ input_offload_tables (void) ...@@ -1915,7 +1915,8 @@ input_offload_tables (void)
/* Prevent IPA from removing fn_decl as unreachable, since there /* Prevent IPA from removing fn_decl as unreachable, since there
may be no refs from the parent function to child_fn in offload may be no refs from the parent function to child_fn in offload
LTO mode. */ 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) else if (tag == LTO_symtab_variable)
{ {
...@@ -1926,7 +1927,8 @@ input_offload_tables (void) ...@@ -1926,7 +1927,8 @@ input_offload_tables (void)
/* Prevent IPA from removing var_decl as unused, since there /* Prevent IPA from removing var_decl as unused, since there
may be no refs to var_decl in offload LTO mode. */ 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 else
fatal_error (input_location, fatal_error (input_location,
......
...@@ -915,7 +915,7 @@ bool lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t, ...@@ -915,7 +915,7 @@ bool lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t,
void output_symtab (void); void output_symtab (void);
void input_symtab (void); void input_symtab (void);
void output_offload_tables (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 *, bool referenced_from_other_partition_p (struct ipa_ref_list *,
lto_symtab_encoder_t); lto_symtab_encoder_t);
bool reachable_from_other_partition_p (struct cgraph_node *, bool reachable_from_other_partition_p (struct cgraph_node *,
......
2016-02-15 Tom de Vries <tom@codesourcery.com>
PR lto/69655
* lto.c (read_cgraph_and_symbols): Call input_offload_tables with
argument.
2016-01-27 Martin Liska <mliska@suse.cz> 2016-01-27 Martin Liska <mliska@suse.cz>
* lto-partition.c (add_symbol_to_partition_1): Remove usage * lto-partition.c (add_symbol_to_partition_1): Remove usage
......
...@@ -2855,7 +2855,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) ...@@ -2855,7 +2855,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* Read the symtab. */ /* Read the symtab. */
input_symtab (); input_symtab ();
input_offload_tables (); input_offload_tables (!flag_ltrans);
/* Store resolutions into the symbol table. */ /* Store resolutions into the symbol table. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment