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/cgraphclones.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/cgraphclones.c')
-rw-r--r-- | gcc/cgraphclones.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index 97eb927..686c2890 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -771,33 +771,35 @@ cgraph_node::create_edge_including_clones (cgraph_node *callee, node = clones; if (node) while (node != this) - { - cgraph_edge *edge = node->get_edge (old_stmt); - - /* It is possible that clones already contain the edge while - master didn't. Either we promoted indirect call into direct - call in the clone or we are processing clones of unreachable - master where edges has been removed. */ - if (edge) - edge->set_call_stmt (stmt); - else if (! node->get_edge (stmt)) - { - edge = node->create_edge (callee, stmt, count, freq); - edge->inline_failed = reason; - } + /* Thunk clones do not get updated while copying inline function body. */ + if (!node->thunk.thunk_p) + { + cgraph_edge *edge = node->get_edge (old_stmt); + + /* It is possible that clones already contain the edge while + master didn't. Either we promoted indirect call into direct + call in the clone or we are processing clones of unreachable + master where edges has been removed. */ + if (edge) + edge->set_call_stmt (stmt); + else if (! node->get_edge (stmt)) + { + edge = node->create_edge (callee, stmt, count, freq); + edge->inline_failed = reason; + } - if (node->clones) - node = node->clones; - else if (node->next_sibling_clone) - node = node->next_sibling_clone; - else - { - while (node != this && !node->next_sibling_clone) - node = node->clone_of; - if (node != this) - node = node->next_sibling_clone; - } - } + if (node->clones) + node = node->clones; + else if (node->next_sibling_clone) + node = node->next_sibling_clone; + else + { + while (node != this && !node->next_sibling_clone) + node = node->clone_of; + if (node != this) + node = node->next_sibling_clone; + } + } } /* Remove the node from cgraph and all inline clones inlined into it. |