This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto][patch] Don't compress the IL symbol table
- From: Rafael Espindola <espindola at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 30 Sep 2009 19:14:28 -0400
- Subject: [lto][patch] Don't compress the IL symbol table
The plugin doesn't expect the symbol table to be compressed. This
patch disables compression for the section used to store the IL symbol
table. It would also be possible to change the plugin so that it could
read compressed symbol tables, but it is probably better to keep it
simpler.
The compiler itself doesn't read the symbol table.
2009-09-30 Rafael Avila de Espindola <espindola@google.com>
* lto-opts.c (lto_write_options): Update call to lto_begin_section.
* lto-section-out.c (lto_begin_section): Add a compress argument.
Update all callers.
(produce_symtab): Don't compress.
* lto-section-out.h (lto_begin_section): Add a compress argument.
Cheers,
--
Rafael Ãvila de EspÃndola
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 0567cc2..145ad00 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -289,7 +289,7 @@ lto_write_options (void)
struct lto_simple_header header;
struct lto_output_stream *header_stream;
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
memset (&stream, 0, sizeof (stream));
diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
index 9b1ae3c..9735e39 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -168,7 +168,7 @@ static struct lto_compression_stream *compression_stream = NULL;
/* Begin a new output section named NAME. */
void
-lto_begin_section (const char *name)
+lto_begin_section (const char *name, bool compress)
{
lang_hooks.lto.begin_section (name);
@@ -176,7 +176,7 @@ lto_begin_section (const char *name)
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 (!flag_wpa)
+ if (compress)
compression_stream = lto_start_compression (lto_append_data, NULL);
}
@@ -529,7 +529,7 @@ lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
struct lto_output_stream *header_stream;
section_name = lto_get_section_name (ob->section_type, NULL);
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* Write the header which says how to decode the pieces of the
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 10adfeb..f939769 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1780,7 +1780,7 @@ produce_asm (struct output_block *ob, tree fn)
else
section_name = lto_get_section_name (section_type, NULL);
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* The entire header is stream computed here. */
@@ -2004,7 +2004,7 @@ copy_function (struct cgraph_node *node)
struct lto_in_decl_state *in_state;
struct lto_out_decl_state *out_state = lto_get_out_decl_state ();
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* We may have renamed the declaration, e.g., a static function. */
@@ -2402,7 +2402,7 @@ produce_symtab (struct lto_streamer_cache_d *cache)
char *section_name = lto_get_section_name (LTO_section_symtab, NULL);
bitmap seen;
- lto_begin_section (section_name);
+ lto_begin_section (section_name, false);
free (section_name);
seen = lto_bitmap_alloc ();
@@ -2444,7 +2444,7 @@ produce_asm_for_decls (cgraph_node_set set)
memset (&header, 0, sizeof (struct lto_decl_header));
section_name = lto_get_section_name (LTO_section_decls, NULL);
- lto_begin_section (section_name);
+ lto_begin_section (section_name, !flag_wpa);
free (section_name);
/* Make string 0 be a NULL string. */
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index afe7e54..a8ec41f 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -733,7 +733,7 @@ extern hashval_t lto_hash_decl_slot_node (const void *);
extern int lto_eq_decl_slot_node (const void *, const void *);
extern hashval_t lto_hash_type_slot_node (const void *);
extern int lto_eq_type_slot_node (const void *, const void *);
-extern void lto_begin_section (const char *);
+extern void lto_begin_section (const char *, bool);
extern void lto_end_section (void);
extern void lto_write_stream (struct lto_output_stream *);
extern void lto_output_1_stream (struct lto_output_stream *, char);