aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2013-06-24 14:40:17 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2013-06-24 14:40:17 +0200
commit44a60244592da0196f7c1d8cfe56bc95d7cdae0e (patch)
treef89f7096e73c7e3897bc706a86a08d49270d459d /gcc/cgraphclones.c
parent7c5848b89955c3ec45a78630f23d610f13e3e47b (diff)
downloadgcc-44a60244592da0196f7c1d8cfe56bc95d7cdae0e.zip
gcc-44a60244592da0196f7c1d8cfe56bc95d7cdae0e.tar.gz
gcc-44a60244592da0196f7c1d8cfe56bc95d7cdae0e.tar.bz2
re PR tree-optimization/57539 (ice in ipa_edge_duplication_hook)
2013-06-24 Martin Jambor <mjambor@suse.cz> PR tree-optimization/57539 * cgraphclones.c (cgraph_clone_node): Add parameter new_inlined_to, set global.inlined_to of the new node to it. All callers changed. * ipa-inline-transform.c (clone_inlined_nodes): New variable inlining_into, pass it to cgraph_clone_node. * ipa-prop.c (ipa_propagate_indirect_call_infos): Do not call ipa_free_edge_args_substructures. (ipa_edge_duplication_hook): Only add edges from inlined nodes to rdesc linked list. Do not assert rdesc edges have inlined caller. Assert we have found an rdesc in the rdesc list. From-SVN: r200368
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r--gcc/cgraphclones.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index d82eb37..f2a57fc 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -167,13 +167,19 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
function's profile to reflect the fact that part of execution is handled
by node.
When CALL_DUPLICATOIN_HOOK is true, the ipa passes are acknowledged about
- the new clone. Otherwise the caller is responsible for doing so later. */
+ the new clone. Otherwise the caller is responsible for doing so later.
+
+ If the new node is being inlined into another one, NEW_INLINED_TO should be
+ the outline function the new one is (even indirectly) inlined to. All hooks
+ will see this in node's global.inlined_to, when invoked. Can be NULL if the
+ node is not inlined. */
struct cgraph_node *
cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
bool update_original,
vec<cgraph_edge_p> redirect_callers,
- bool call_duplication_hook)
+ bool call_duplication_hook,
+ struct cgraph_node *new_inlined_to)
{
struct cgraph_node *new_node = cgraph_create_empty_node ();
struct cgraph_edge *e;
@@ -195,6 +201,7 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
new_node->symbol.externally_visible = false;
new_node->local.local = true;
new_node->global = n->global;
+ new_node->global.inlined_to = new_inlined_to;
new_node->rtl = n->rtl;
new_node->count = count;
new_node->frequency = n->frequency;
@@ -307,7 +314,7 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
new_node = cgraph_clone_node (old_node, new_decl, old_node->count,
CGRAPH_FREQ_BASE, false,
- redirect_callers, false);
+ redirect_callers, false, NULL);
/* Update the properties.
Make clone visible only within this translation unit. Make sure
that is not weak also.