This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] Merge from trunk rev 151592.


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]