aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2016-02-15 09:30:31 +0000
committerTom de Vries <vries@gcc.gnu.org>2016-02-15 09:30:31 +0000
commited5d948da920f8de6041b7010625cfeff7014203 (patch)
tree24bbedf25b4db21dabf774f9f1f9752681a677a7 /gcc
parent1c48bff185df422d6f9f980fd02466606be2ccd4 (diff)
downloadgcc-ed5d948da920f8de6041b7010625cfeff7014203.zip
gcc-ed5d948da920f8de6041b7010625cfeff7014203.tar.gz
gcc-ed5d948da920f8de6041b7010625cfeff7014203.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/lto-cgraph.c8
-rw-r--r--gcc/lto-streamer.h2
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto.c2
5 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 565b505..59be0fd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
PR tree-optimization/69776
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 0634779..95c446d 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 0cb200e..f3911613 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 43faaf4..6496fd9 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+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>
* lto-partition.c (add_symbol_to_partition_1): Remove usage
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 6718fbbe..9dd513f 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. */