aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2011-04-03 11:21:06 +0000
committerMichael Matz <matz@gcc.gnu.org>2011-04-03 11:21:06 +0000
commite89964e31c5f26caefe5fffb0ccc1fb4932f44bc (patch)
tree1e63a8bdd37fbff2c65aec3206ef1005c2481cd1 /gcc/lto
parentb9a5b5b2a2771889f315d778629dc7e6245a69cf (diff)
downloadgcc-e89964e31c5f26caefe5fffb0ccc1fb4932f44bc.zip
gcc-e89964e31c5f26caefe5fffb0ccc1fb4932f44bc.tar.gz
gcc-e89964e31c5f26caefe5fffb0ccc1fb4932f44bc.tar.bz2
lto-streamer.h (struct lto_streamer_cache_d): Remove offsets and next_slot members.
* lto-streamer.h (struct lto_streamer_cache_d): Remove offsets and next_slot members. (lto_streamer_cache_insert, lto_streamer_cache_insert_at, lto_streamer_cache_lookup, lto_streamer_cache_get): Adjust prototypes. (lto_streamer_cache_append): Declare. * lto-streamer.c (lto_streamer_cache_add_to_node_array): Use unsigned index, remove offset parameter, ensure that we append or update existing entries. (lto_streamer_cache_insert_1): Use unsigned index, remove offset_p parameter, update next_slot for append. (lto_streamer_cache_insert): Use unsigned index, remove offset_p parameter. (lto_streamer_cache_insert_at): Likewise. (lto_streamer_cache_append): New function. (lto_streamer_cache_lookup): Use unsigned index. (lto_streamer_cache_get): Likewise. (lto_record_common_node): Don't test tree_node_can_be_shared. (preload_common_node): Adjust call to lto_streamer_cache_insert. (lto_streamer_cache_delete): Don't free offsets member. * lto-streamer-out.c (eq_string_slot_node): Use memcmp. (lto_output_string_with_length): Use lto_output_data_stream. (lto_output_tree_header): Remove ix parameter, don't write it. (lto_output_builtin_tree): Likewise. (lto_write_tree): Adjust callers to above, don't track and write offset, write unsigned index. (output_unreferenced_globals): Don't emit all global vars. (write_global_references): Use unsigned indices. (lto_output_decl_state_refs): Likewise. (write_symbol): Likewise. * lto-streamer-in.c (lto_input_chain): Move earlier. (input_function): Use unsigned index. (input_alias_pairs): Don't read and then ignore all global vars. (lto_materialize_tree): Remove ix_p parameter, don't read index, don't pass it back, use lto_streamer_cache_append. (lto_register_var_decl_in_symtab): Use unsigned index. (lto_register_function_decl_in_symtab): Likewise. (lto_get_pickled_tree): Don't read in or handle offset, read unsigned index. (lto_get_builtin_tree): Don't read index, use lto_streamer_cache_append. (lto_read_tree): Adjust call to lto_materialize_tree. * ipa-inline.c (cgraph_edge_badness): Move growth calculaton, don't use function calls in arguments to MIN. * varasm.c (decl_binds_to_current_def_p): Don't check TREE_PUBLIC twice. * gimple.c (gimple_type_leader_entry): Mark deletable. lto/ * lto.c (lto_materialize_function): Don't read and then discard sections in WPA mode. (lto_read_in_decl_state): Adjust call to lto_streamer_cache_get. * lto-lang.c (registered_builtin_fndecls): Remove. (lto_getdecls): Return NULL_TREE. (lto_builtin_function): Don't remember in registered_builtin_fndecls. From-SVN: r171906
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog10
-rw-r--r--gcc/lto/lto-lang.c14
-rw-r--r--gcc/lto/lto.c39
3 files changed, 33 insertions, 30 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 3ea90da..00f695f 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,13 @@
+2011-04-03 Michael Matz <matz@suse.de>
+
+ * lto.c (lto_materialize_function): Don't read and then discard
+ sections in WPA mode.
+ (lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.
+
+ * lto-lang.c (registered_builtin_fndecls): Remove.
+ (lto_getdecls): Return NULL_TREE.
+ (lto_builtin_function): Don't remember in registered_builtin_fndecls.
+
2011-03-31 Richard Guenther <rguenther@suse.de>
PR lto/48246
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 3c804f5..535fc58 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -615,11 +615,6 @@ lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED,
static GTY(()) tree registered_builtin_types;
-/* A chain of builtin functions that we need to recognize. We will
- assume that all other function names we see will be defined by the
- user's program. */
-static GTY(()) tree registered_builtin_fndecls;
-
/* Language hooks. */
static unsigned int
@@ -994,7 +989,10 @@ lto_pushdecl (tree t ATTRIBUTE_UNUSED)
static tree
lto_getdecls (void)
{
- return registered_builtin_fndecls;
+ /* We have our own write_globals langhook, hence the getdecls
+ langhook shouldn't be used, except by dbxout.c, so we can't
+ just abort here. */
+ return NULL_TREE;
}
static void
@@ -1010,10 +1008,6 @@ lto_write_globals (void)
static tree
lto_builtin_function (tree decl)
{
- /* Record it. */
- TREE_CHAIN (decl) = registered_builtin_fndecls;
- registered_builtin_fndecls = decl;
-
return decl;
}
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 6ab7535..556e7e6 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -149,37 +149,36 @@ lto_materialize_function (struct cgraph_node *node)
/* Clones don't need to be read. */
if (node->clone_of)
return;
- file_data = node->local.lto_file_data;
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
- /* We may have renamed the declaration, e.g., a static function. */
- name = lto_get_decl_name_mapping (file_data, name);
-
- data = lto_get_section_data (file_data, LTO_section_function_body,
- name, &len);
- if (!data)
- fatal_error ("%s: section %s is missing",
- file_data->file_name,
- name);
-
- gcc_assert (DECL_STRUCT_FUNCTION (decl) == NULL);
/* Load the function body only if not operating in WPA mode. In
WPA mode, the body of the function is not needed. */
if (!flag_wpa)
{
+ file_data = node->local.lto_file_data;
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+
+ /* We may have renamed the declaration, e.g., a static function. */
+ name = lto_get_decl_name_mapping (file_data, name);
+
+ data = lto_get_section_data (file_data, LTO_section_function_body,
+ name, &len);
+ if (!data)
+ fatal_error ("%s: section %s is missing",
+ file_data->file_name,
+ name);
+
+ gcc_assert (DECL_STRUCT_FUNCTION (decl) == NULL);
+
allocate_struct_function (decl, false);
announce_function (decl);
lto_input_function_body (file_data, decl, data);
if (DECL_FUNCTION_PERSONALITY (decl) && !first_personality_decl)
first_personality_decl = DECL_FUNCTION_PERSONALITY (decl);
lto_stats.num_function_bodies++;
+ lto_free_section_data (file_data, LTO_section_function_body, name,
+ data, len);
+ ggc_collect ();
}
-
- lto_free_section_data (file_data, LTO_section_function_body, name,
- data, len);
- if (!flag_wpa)
- ggc_collect ();
}
/* Let the middle end know about the function. */
@@ -200,7 +199,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data,
uint32_t i, j;
ix = *data++;
- decl = lto_streamer_cache_get (data_in->reader_cache, (int) ix);
+ decl = lto_streamer_cache_get (data_in->reader_cache, ix);
if (TREE_CODE (decl) != FUNCTION_DECL)
{
gcc_assert (decl == void_type_node);