From 3afbcf4cd22c81332431b9d387b1ef616310a5fe Mon Sep 17 00:00:00 2001
From: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sun, 13 Dec 2015 02:13:15 +0000
Subject: 	* cgraph.c (cgraph_node::get_untransformed_body): Pass
 compressed 	flag to lto_get_section_data. 	* varpool.c
 (varpool_node::get_constructor): Likewise. 	* lto-section-in.c
 (lto_get_section_data): Add new flag decompress. 
 (lto_free_section_data): Likewise. 	(lto_get_raw_section_data): New
 function. 	(lto_free_raw_section_data): New function. 
 (copy_function_or_variable): Copy sections w/o decompressing. 
 (lto_output_decl_state_refs): Picke compressed bit. 	* lto-streamer.h
 (lto_in_decl_state): New flag compressed. 	(lto_out_decl_state):
 Likewise. 	(lto_get_section_data, lto_free_section_data): Update
 prototypes 	(lto_get_raw_section_data, lto_free_raw_section_data):
 Declare. 	(lto_write_raw_data): Declare. 	(lto_begin_section): Remove
 FIXME. 	(lto_write_raw_data): New function. 	(lto_write_stream):
 Remove FIXME. 	(lto_new_out_decl_state): Set compressed flag.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231594 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/lto-section-out.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

(limited to 'gcc/lto-section-out.c')

diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
index 56b460bea54..f547cc3b62c 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -66,9 +66,6 @@ lto_begin_section (const char *name, bool compress)
 {
   lang_hooks.lto.begin_section (name);
 
-  /* FIXME lto: for now, suppress compression if the lang_hook that appends
-     data is anything other than assembler output.  The effect here is that
-     we get compression of IL only in non-ltrans object files.  */
   gcc_assert (compression_stream == NULL);
   if (compress)
     compression_stream = lto_start_compression (lto_append_data, NULL);
@@ -99,6 +96,14 @@ lto_write_data (const void *data, unsigned int size)
     lang_hooks.lto.append_data ((const char *)data, size, NULL);
 }
 
+/* Write SIZE bytes starting at DATA to the assembler.  */
+
+void
+lto_write_raw_data (const void *data, unsigned int size)
+{
+  lang_hooks.lto.append_data ((const char *)data, size, NULL);
+}
+
 /* Write all of the chars in OBS to the assembler.  Recycle the blocks
    in obs as this is being done.  */
 
@@ -123,10 +128,6 @@ lto_write_stream (struct lto_output_stream *obs)
       if (!next_block)
 	num_chars -= obs->left_in_block;
 
-      /* FIXME lto: WPA mode uses an ELF function as a lang_hook to append
-         output data.  This hook is not happy with the way that compression
-         blocks up output differently to the way it's blocked here.  So for
-         now, we don't compress WPA output.  */
       if (compression_stream)
 	lto_compress_block (compression_stream, base, num_chars);
       else
@@ -295,6 +296,9 @@ lto_new_out_decl_state (void)
   for (i = 0; i < LTO_N_DECL_STREAMS; i++)
     lto_init_tree_ref_encoder (&state->streams[i]);
 
+  /* At WPA time we do not compress sections by default.  */
+  state->compressed = !flag_wpa;
+
   return state;
 }
 
-- 
cgit v1.2.1