aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-10-17 19:53:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-10-17 19:53:18 +0000
commitd83fa499b9895618ae8f63c004f3090b71d488ae (patch)
tree301efc828166e84e581576aed480b1108b228812 /gcc/ipa-inline-transform.c
parentd9b7be2ebd0cf4652590c2db4313c8435a9a66a9 (diff)
downloadgcc-d83fa499b9895618ae8f63c004f3090b71d488ae.zip
gcc-d83fa499b9895618ae8f63c004f3090b71d488ae.tar.gz
gcc-d83fa499b9895618ae8f63c004f3090b71d488ae.tar.bz2
ipa-inline-transform.c (master_clone_with_noninline_clones_p): New.
* ipa-inline-transform.c (master_clone_with_noninline_clones_p): New. (clone_inlined_nodes): Do not overwrite the clone if above predicate returns true. From-SVN: r216415
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 4b0fcad..1cb4c05 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -122,6 +122,20 @@ can_remove_node_now_p (struct cgraph_node *node, struct cgraph_edge *e)
return true;
}
+/* Return true if NODE is a master clone with non-inline clones. */
+
+static bool
+master_clone_with_noninline_clones_p (struct cgraph_node *node)
+{
+ if (node->clone_of)
+ return false;
+
+ for (struct cgraph_node *n = node->clones; n; n = n->next_sibling_clone)
+ if (n->decl != node->decl)
+ return true;
+
+ return false;
+}
/* E is expected to be an edge being inlined. Clone destination node of
the edge and redirect it to the new clone.
@@ -155,7 +169,10 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
/* Recursive inlining never wants the master clone to
be overwritten. */
&& update_original
- && can_remove_node_now_p (e->callee, e))
+ && can_remove_node_now_p (e->callee, e)
+ /* We cannot overwrite a master clone with non-inline clones
+ until after these clones are materialized. */
+ && !master_clone_with_noninline_clones_p (e->callee))
{
/* TODO: When callee is in a comdat group, we could remove all of it,
including all inline clones inlined into it. That would however