diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2016-05-18 09:12:46 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2016-05-18 07:12:46 +0000 |
commit | ec6a1e35322a8b9b008c5fef7a8effdbf17b68eb (patch) | |
tree | 51f4dc565b802a5108ca6b8ff2ddbbb66ebc9e33 /gcc/ipa-inline-transform.c | |
parent | df8b0a111998b29f47616001251333ce36984353 (diff) | |
download | gcc-ec6a1e35322a8b9b008c5fef7a8effdbf17b68eb.zip gcc-ec6a1e35322a8b9b008c5fef7a8effdbf17b68eb.tar.gz gcc-ec6a1e35322a8b9b008c5fef7a8effdbf17b68eb.tar.bz2 |
ipa-inline-transform.c (preserve_function_body_p): Look for first non-thunk clone.
* ipa-inline-transform.c (preserve_function_body_p): Look for
first non-thunk clone.
(save_function_body): Save into first non-thunk.
* lto-cgraph.c (lto_output_edge): When streaming thunk do not look
up call stmt id.
(lto_output_node): Inline thunks don't need body in every
partition.
* lto-streamer-in.c: Do not fixup thunk clones.
* cgraphclones.c (cgraph_node::create_edge_including_clone): Skip
thunks.
* tree-inline.c (copy_bb): Be prepared for target node to be new after
folding suceeds.
From-SVN: r236357
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r-- | gcc/ipa-inline-transform.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c index 1e6e108..90a0d7e 100644 --- a/gcc/ipa-inline-transform.c +++ b/gcc/ipa-inline-transform.c @@ -506,6 +506,22 @@ save_inline_function_body (struct cgraph_node *node) /* first_clone will be turned into real function. */ first_clone = node->clones; + + /* Arrange first clone to not be thunk as those do not have bodies. */ + if (first_clone->thunk.thunk_p) + { + while (first_clone->thunk.thunk_p) + first_clone = first_clone->next_sibling_clone; + first_clone->prev_sibling_clone->next_sibling_clone + = first_clone->next_sibling_clone; + if (first_clone->next_sibling_clone) + first_clone->next_sibling_clone->prev_sibling_clone + = first_clone->prev_sibling_clone; + first_clone->next_sibling_clone = node->clones; + first_clone->prev_sibling_clone = NULL; + node->clones->prev_sibling_clone = first_clone; + node->clones = first_clone; + } first_clone->decl = copy_node (node->decl); first_clone->decl->decl_with_vis.symtab_node = first_clone; gcc_assert (first_clone == cgraph_node::get (first_clone->decl)); @@ -514,7 +530,8 @@ save_inline_function_body (struct cgraph_node *node) first_clone. */ if (first_clone->next_sibling_clone) { - for (n = first_clone->next_sibling_clone; n->next_sibling_clone; n = n->next_sibling_clone) + for (n = first_clone->next_sibling_clone; n->next_sibling_clone; + n = n->next_sibling_clone) n->clone_of = first_clone; n->clone_of = first_clone; n->next_sibling_clone = first_clone->clones; @@ -587,9 +604,10 @@ preserve_function_body_p (struct cgraph_node *node) gcc_assert (symtab->global_info_ready); gcc_assert (!node->alias && !node->thunk.thunk_p); - /* Look if there is any clone around. */ - if (node->clones && !node->clones->thunk.thunk_p) - return true; + /* Look if there is any non-thunk clone around. */ + for (node = node->clones; node; node = node->next_sibling_clone) + if (!node->thunk.thunk_p) + return true; return false; } |