Don't mark offload symbols with force_output in ltrans
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Feb 2016 09:30:31 +0000 (09:30 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Feb 2016 09:30:31 +0000 (09:30 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233419 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/lto-cgraph.c
gcc/lto-streamer.h
gcc/lto/ChangeLog
gcc/lto/lto.c

index 565b505..59be0fd 100644 (file)
@@ -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
index 0634779..95c446d 100644 (file)
@@ -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,
index 0cb200e..f391161 100644 (file)
@@ -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 *,
index 43faaf4..6496fd9 100644 (file)
@@ -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
index 6718fbb..9dd513f 100644 (file)
@@ -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.  */