From 21543d4cd558cada630271a0cf3075ad7ce94cbf Mon Sep 17 00:00:00 2001 From: bstarynk Date: Wed, 26 Jun 2013 18:39:06 +0000 Subject: 2013-06-26 Basile Starynkevitch {{merged with trunk [4.9] svn rev. 196654-200426}} MELT branch merged with trunk rev. 200426 using svnmerge.py [gcc/] 2013-06-26 Basile Starynkevitch {{merge with trunk [4.9] svn rev. 196654-200426}} * melt-runtime.c (melt_val2passflag): TODO_ggc_collect & TODO_do_not_ggc_collect are conditionalized. * melt/generated/warmelt-first+03.cc: Manually remove calls to MELT_TRACE_EXIT_LOCATION macro. * melt/generated/warmelt-base+03.cc: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@200430 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ipa-inline-transform.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'gcc/ipa-inline-transform.c') diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c index cac20fecc3b..d421c87c222 100644 --- a/gcc/ipa-inline-transform.c +++ b/gcc/ipa-inline-transform.c @@ -132,6 +132,13 @@ void clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, bool update_original, int *overall_size) { + struct cgraph_node *inlining_into; + + if (e->caller->global.inlined_to) + inlining_into = e->caller->global.inlined_to; + else + inlining_into = e->caller; + if (duplicate) { /* We may eliminate the need for out-of-line copy to be output. @@ -153,7 +160,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, cgraph_remove_unreachable_functions gets rid of them. */ gcc_assert (!e->callee->global.inlined_to); symtab_dissolve_same_comdat_group_list ((symtab_node) e->callee); - if (e->callee->analyzed && !DECL_EXTERNAL (e->callee->symbol.decl)) + if (e->callee->symbol.definition && !DECL_EXTERNAL (e->callee->symbol.decl)) { if (overall_size) *overall_size -= inline_summary (e->callee)->size; @@ -167,18 +174,15 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, { struct cgraph_node *n; n = cgraph_clone_node (e->callee, e->callee->symbol.decl, - e->count, e->frequency, - update_original, vNULL, true); + e->count, e->frequency, update_original, + vNULL, true, inlining_into); cgraph_redirect_edge_callee (e, n); } } else symtab_dissolve_same_comdat_group_list ((symtab_node) e->callee); - if (e->caller->global.inlined_to) - e->callee->global.inlined_to = e->caller->global.inlined_to; - else - e->callee->global.inlined_to = e->caller; + e->callee->global.inlined_to = inlining_into; /* Recursively clone all bodies. */ for (e = e->callee->callees; e; e = e->next_callee) @@ -236,7 +240,7 @@ inline_call (struct cgraph_edge *e, bool update_original, if (!alias->callers && can_remove_node_now_p (alias, e)) { - next_alias = cgraph_alias_aliased_node (alias); + next_alias = cgraph_alias_target (alias); cgraph_remove_node (alias); alias = next_alias; } @@ -260,7 +264,7 @@ inline_call (struct cgraph_edge *e, bool update_original, #ifdef ENABLE_CHECKING /* Verify that estimated growth match real growth. Allow off-by-one error due to INLINE_SIZE_SCALE roudoff errors. */ - gcc_assert (!update_overall_summary || !overall_size + gcc_assert (!update_overall_summary || !overall_size || new_edges_found || abs (estimated_growth - (new_size - old_size)) <= 1 /* FIXME: a hack. Edges with false predicate are accounted wrong, we should remove them from callgraph. */ @@ -381,7 +385,7 @@ static bool preserve_function_body_p (struct cgraph_node *node) { gcc_assert (cgraph_global_info_ready); - gcc_assert (!node->alias && !node->thunk.thunk_p); + gcc_assert (!node->symbol.alias && !node->thunk.thunk_p); /* Look if there is any clone around. */ if (node->clones) -- cgit v1.2.1