+2014-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ipa-inline-transform.c (master_clone_with_noninline_clones_p): New.
+ (clone_inlined_nodes): Do not overwrite the clone if above predicate
+ returns true.
+
2014-10-17 Ilya Tocar <ilya.tocar@intel.com>
* config/i386/i386.c (MAX_VECT_LEN): Move earlier.
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.
/* 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