This is the mail archive of the 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]

Re: [lto][patch] Remove nodes for extern inline function before writing to disk

> OK, let's just call it from lto_output() directly, then.  It doesn't
> make sense to introduce a new pass just to call this function.

I am testing the attached patch.

2008-10-09 Rafael Espindola  <>

	* lto-cgraph.c (output_edge): Assert that the caller is not external.
	* lto-function-out.c (lto_output): Call cgraph_remove_unreachable_nodes.

Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 12fad49..5ebdd50 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -167,6 +167,8 @@ output_edge (struct lto_simple_output_block *ob,
   intptr_t ref;
   unsigned HOST_WIDEST_INT flags = 0;
+  gcc_assert (!DECL_EXTERNAL (edge->caller->decl));
   lto_output_uleb128_stream (ob->main_stream, LTO_cgraph_edge);
   LTO_DEBUG_INDENT (LTO_cgraph_edge);
diff --git a/gcc/lto-function-out.c b/gcc/lto-function-out.c
index 90dedad..17621f2 100644
--- a/gcc/lto-function-out.c
+++ b/gcc/lto-function-out.c
@@ -2379,6 +2379,9 @@ lto_output (cgraph_node_set set)
   struct lto_out_decl_state *decl_state;
   cgraph_node_set_iterator csi;
+  /* Remove bodies of extern inline functions we never inlined. */
+  cgraph_remove_unreachable_nodes (false, dump_file);
   bitmap_obstack_initialize (NULL);
   lto_static_init_local ();

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