public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix partitioning of inline thunks
@ 2016-05-15 22:19 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2016-05-15 22:19 UTC (permalink / raw)
  To: gcc-patches

Hi,
this patch fixes the partitioner WRT inlined thunks. When thunk is offline, we
must place it into the same unit as its target (because ASM thunk output machinery
is not designed for non-local calls). However when thunk is inlined it behave
like other functions and in particular we do not want to drag inline clone into
an unit where it is defined.

I hope this fixed the xalancbmk ICE reported, but I did not double check since
I do not have build tree handy.  It fixed Firefox ICE at sameplace that appears
after applying the previous patch.

Bootstrapped/regtested x86_64-linux, will commit it tomorrow.

	* lto-cgraph.c (compute_ltrans_boundary, output_symtab): Fix handling
	of inline thunks

	* lto-partition.c (add_symbol_to_partition_1): Likewise.
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c	(revision 236211)
+++ lto-cgraph.c	(working copy)
@@ -972,7 +972,7 @@ compute_ltrans_boundary (lto_symtab_enco
       if (node->alias && node->analyzed)
 	create_references (encoder, node);
       if (cnode
-	  && cnode->thunk.thunk_p)
+	  && cnode->thunk.thunk_p && !cnode->global.inlined_to)
 	add_node_to (encoder, cnode->callees->callee, false);
       while (node->transparent_alias && node->analyzed)
 	{
@@ -1028,7 +1028,7 @@ output_symtab (void)
     {
       node = dyn_cast <cgraph_node *> (lto_symtab_encoder_deref (encoder, i));
       if (node
-	  && (node->thunk.thunk_p
+	  && ((node->thunk.thunk_p && !node->global.inlined_to)
 	      || lto_symtab_encoder_in_partition_p (encoder, node)))
 	{
 	  output_outgoing_cgraph_edges (node->callees, ob, encoder);
Index: lto/lto-partition.c
===================================================================
--- lto/lto-partition.c	(revision 236211)
+++ lto/lto-partition.c	(working copy)
@@ -163,7 +163,7 @@ add_symbol_to_partition_1 (ltrans_partit
 
       /* Add all thunks associated with the function.  */
       for (e = cnode->callers; e; e = e->next_caller)
-	if (e->caller->thunk.thunk_p)
+	if (e->caller->thunk.thunk_p && !e->caller->global.inlined_to)
 	  add_symbol_to_partition_1 (part, e->caller);
 
       /* Instrumented version is actually the same function.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-15 22:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-15 22:19 Fix partitioning of inline thunks Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).