This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[lto] Merge from trunk rev 151592 (repost)
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc at gcc dot gnu dot org, Richard Guenther <rguenther at suse dot de>
- Date: Fri, 11 Sep 2009 16:08:02 -0400
- Subject: [lto] Merge from trunk rev 151592 (repost)
Reposting. Apparently gmail has been labelling messages from
google.com as spam. It should be fixed now.
Diego.
---------- Forwarded message ----------
From: Diego Novillo <dnovillo@google.com>
Date: Fri, Sep 11, 2009 at 11:37
Subject: [lto] Merge from trunk rev 151592.
To: gcc@gcc.gnu.org
Cc: rguenther@suse.de
This merge uncovered a bug in cgraph node streaming. ÂThere were
several bitflags that were not being written out. ÂI also removed
a few old patches that are no longer needed.
Once the EH changes are in mainline, we'll be ready to merge the
streamer, which is the only module left to merge.
Bootstrapped and tested on x86_64.
Diego.
2009-09-11 ÂDiego Novillo Â<dnovillo@google.com>
   ÂMainline merge @151592.
   Â* configure.ac (ACX_PKGVERSION): Update revision merge string.
   Â* configure: Regenerate.
2009-09-11 ÂDiego Novillo Â<dnovillo@google.com>
   Â* cgraph.c (cgraph_clone_input_node): Remove. ÂUpdate all users to
   Âcall cgraph_clone_node instead.
   Â(cgraph_is_clone_node): Remove unused function.
   Â* ipa.c (cgraph_remove_unreachable_nodes): Do not set
   Âdisregard_inline_limits to false.
   Â(gate_ipa_fun_and_var_visibility): Remove. ÂUpdate
   Âpass_ipa_function_and_variable_visibility.
   Â* lto-cgraph.c (lto_output_node): Output field count.
   ÂReorganize packing of node bitflags to follow the same
   Âorder that they're declared.
   ÂAdd fields address_taken, abstract_and_needed, reachable,
   Âprocess, alias and finalized_by_frontend.
   Â(input_overwrite_node): Corresponding changes.
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 11a9ed2..3d49b8d 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1713,44 +1713,6 @@ cgraph_clone_node (struct cgraph_node *n,
gcov_type count, int freq,
 return new_node;
Â}
-/* Create node representing clone of N during when reading the call-graph
- Â from an LTO stream. ÂThis is simpler than cgraph_clone_node. ÂAdditional
- Â information in the cloned node will be filled in later. */
-
-struct cgraph_node *
-cgraph_clone_input_node (struct cgraph_node *n)
-{
- Âstruct cgraph_node *new_node = cgraph_create_node ();
-
- Ânew_node->decl = n->decl;
- Ânew_node->origin = n->origin;
- Âif (new_node->origin)
- Â Â{
- Â Â Ânew_node->next_nested = new_node->origin->nested;
- Â Â Ânew_node->origin->nested = new_node;
- Â Â}
- Ânew_node->analyzed = n->analyzed;
- Ânew_node->local = n->local;
- Ânew_node->global = n->global;
- Ânew_node->rtl = n->rtl;
-
- Ânew_node->next_sibling_clone = n->clones;
- Âif (n->clones)
- Â Ân->clones->prev_sibling_clone = new_node;
- Ân->clones = new_node;
- Ânew_node->clone_of = n;
-
- Âreturn new_node;
-}
-
-/* Return true if N is a cloned node. Â*/
-
-bool
-cgraph_is_clone_node (struct cgraph_node *n)
-{
- Âreturn n->clone_of != NULL;
-}
-
Â/* Create a new name for omp child function. ÂReturns an identifier. Â*/
Âstatic GTY(()) unsigned int clone_fn_id_num;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 3349a57..10617ec 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -422,7 +422,6 @@ struct cgraph_edge * cgraph_clone_edge (struct
cgraph_edge *,
                   Âunsigned, gcov_type, int, int, bool);
Âstruct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, int,
                   Âint, bool);
-struct cgraph_node * cgraph_clone_input_node (struct cgraph_node *);
Âvoid cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *);
@@ -432,7 +431,6 @@ bool cgraph_function_possibly_inlined_p (tree);
Âvoid cgraph_unnest_node (struct cgraph_node *);
Âenum availability cgraph_function_body_availability (struct cgraph_node *);
-bool cgraph_is_clone_node (struct cgraph_node *);
Âvoid cgraph_add_new_function (tree, bool);
Âconst char* cgraph_inline_failed_string (cgraph_inline_failed_t);
Âstruct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 3f7a3ee..9204caa 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -216,7 +216,6 @@ cgraph_remove_unreachable_nodes (bool
before_inlining_p, FILE *file)
          Ânode->analyzed = false;
          Ânode->local.inlinable = false;
         Â}
- Â Â Â Â Â Â Â Â node->local.disregard_inline_limits = false;
       Â}
      Âelse
       Âcgraph_remove_node (node);
@@ -315,18 +314,12 @@ function_and_variable_visibility (void)
 return 0;
Â}
-static bool
-gate_ipa_fun_and_var_visibility (void)
-{
- Âreturn true;
-}
-
Âstruct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
Â{
Â{
 SIMPLE_IPA_PASS,
 "visibility",                Â/* name */
- Âgate_ipa_fun_and_var_visibility, Â Â /* gate */
+ ÂNULL, Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â/* gate */
 function_and_variable_visibility,  Â/* execute */
 NULL,                    Â/* sub */
 NULL,                    Â/* next */
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 899e111..dc85a38 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -243,11 +243,9 @@ lto_output_node (struct lto_simple_output_block
*ob, struct cgraph_node *node,
  bitmap_set_bit (written_decls, DECL_UID (node->decl));
 lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->decl);
+ Âlto_output_sleb128_stream (ob->main_stream, node->count);
 bp = bitpack_create ();
- Âbp_pack_value (bp, node->lowered, 1);
- Âbp_pack_value (bp, node->analyzed, 1);
- Âbp_pack_value (bp, node->needed, 1);
 bp_pack_value (bp, local, 1);
 bp_pack_value (bp, externally_visible, 1);
 bp_pack_value (bp, node->local.finalized, 1);
@@ -256,6 +254,15 @@ lto_output_node (struct lto_simple_output_block
*ob, struct cgraph_node *node,
 bp_pack_value (bp, node->local.redefined_extern_inline, 1);
 bp_pack_value (bp, node->local.for_functions_valid, 1);
 bp_pack_value (bp, node->local.vtable_method, 1);
+ Âbp_pack_value (bp, node->needed, 1);
+ Âbp_pack_value (bp, node->address_taken, 1);
+ Âbp_pack_value (bp, node->abstract_and_needed, 1);
+ Âbp_pack_value (bp, node->reachable, 1);
+ Âbp_pack_value (bp, node->lowered, 1);
+ Âbp_pack_value (bp, node->analyzed, 1);
+ Âbp_pack_value (bp, node->process, 1);
+ Âbp_pack_value (bp, node->alias, 1);
+ Âbp_pack_value (bp, node->finalized_by_frontend, 1);
 lto_output_bitpack (ob->main_stream, bp);
 bitpack_delete (bp);
@@ -374,7 +381,8 @@ output_cgraph (cgraph_node_set set)
 ÂSTACK_SIZE, SELF_TIME and SELF_SIZE. ÂThis is called either to initialize
 ÂNODE or to replace the values in it, for instance because the first
 Âtime we saw it, the function body was not available but now it
- Â is. Â*/
+ Â is. ÂBP is a bitpack with all the bitflags for NODE read from the
+ Â stream. Â*/
Âstatic void
Âinput_overwrite_node (struct lto_file_decl_data *file_data,
@@ -397,9 +405,6 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
 node->global.size = self_size;
 node->local.lto_file_data = file_data;
- Ânode->lowered = bp_unpack_value (bp, 1);
- Ânode->analyzed = bp_unpack_value (bp, 1);
- Ânode->needed = bp_unpack_value (bp, 1);
 node->local.local = bp_unpack_value (bp, 1);
 node->local.externally_visible = bp_unpack_value (bp, 1);
 node->local.finalized = bp_unpack_value (bp, 1);
@@ -408,6 +413,15 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
 node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
 node->local.for_functions_valid = bp_unpack_value (bp, 1);
 node->local.vtable_method = bp_unpack_value (bp, 1);
+ Ânode->needed = bp_unpack_value (bp, 1);
+ Ânode->address_taken = bp_unpack_value (bp, 1);
+ Ânode->abstract_and_needed = bp_unpack_value (bp, 1);
+ Ânode->reachable = bp_unpack_value (bp, 1);
+ Ânode->lowered = bp_unpack_value (bp, 1);
+ Ânode->analyzed = bp_unpack_value (bp, 1);
+ Ânode->process = bp_unpack_value (bp, 1);
+ Ânode->alias = bp_unpack_value (bp, 1);
+ Ânode->finalized_by_frontend = bp_unpack_value (bp, 1);
Â}
@@ -443,10 +457,13 @@ input_node (struct lto_file_decl_data *file_data,
 fn_decl = lto_file_decl_data_get_fn_decl (file_data, decl_index);
 if (clone_p)
- Â Ânode = cgraph_clone_input_node (cgraph_node (fn_decl));
+ Â Ânode = cgraph_clone_node (cgraph_node (fn_decl), 0,
+ Â Â Â Â Â Â Â Â Â Â Â Â Â Â CGRAPH_FREQ_BASE, 0, false);
+
 else
  node = cgraph_node (fn_decl);
+ Ânode->count = lto_input_sleb128 (ib);
 bp = lto_input_bitpack (ib);
 if (tag != LTO_cgraph_unavail_node)