X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Fipa-inline-transform.c;h=9e131a4aa0e78c9ea428004196fbc4763c0ed711;hb=6c84d5762f1e1a60b1d4cee0caf8b4e7e0ba5f6f;hp=60a29628aee33c40a5177804ffe5e5bb029d8a66;hpb=0f378cb5db23d1b2b95387ae8c2b3c8f3662cbb4;p=gcc.git diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c index 60a29628aee..9e131a4aa0e 100644 --- a/gcc/ipa-inline-transform.c +++ b/gcc/ipa-inline-transform.c @@ -1,6 +1,5 @@ /* Callgraph transformations to handle inlining - Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. @@ -93,9 +92,7 @@ can_remove_node_now_p_1 (struct cgraph_node *node) those only after all devirtualizable virtual calls are processed. Lacking may edges in callgraph we just preserve them post inlining. */ - && (!DECL_VIRTUAL_P (node->symbol.decl) - || (!DECL_COMDAT (node->symbol.decl) - && !DECL_EXTERNAL (node->symbol.decl))) + && !DECL_VIRTUAL_P (node->symbol.decl) /* During early inlining some unanalyzed cgraph nodes might be in the callgraph and they might reffer the function in question. */ && !cgraph_new_nodes); @@ -156,7 +153,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; @@ -171,7 +168,7 @@ 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, NULL, true); + update_original, vNULL, true); cgraph_redirect_edge_callee (e, n); } } @@ -202,7 +199,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, bool inline_call (struct cgraph_edge *e, bool update_original, - VEC (cgraph_edge_p, heap) **new_edges, + vec *new_edges, int *overall_size, bool update_overall_summary) { int old_size = 0, new_size = 0; @@ -239,7 +236,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; } @@ -259,17 +256,21 @@ inline_call (struct cgraph_edge *e, bool update_original, if (update_overall_summary) inline_update_overall_summary (to); new_size = inline_summary (to)->size; + #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. */ || predicated); #endif - - if (overall_size) + + /* Account the change of overall unit size; external functions will be + removed and are thus not accounted. */ + if (overall_size + && !DECL_EXTERNAL (to->symbol.decl)) *overall_size += new_size - old_size; ncalls_inlined++; @@ -346,7 +347,8 @@ save_inline_function_body (struct cgraph_node *node) /* Copy the OLD_VERSION_NODE function tree to the new version. */ tree_function_versioning (node->symbol.decl, first_clone->symbol.decl, - NULL, true, NULL, false, NULL, NULL); + NULL, true, NULL, false, + NULL, NULL); /* The function will be short lived and removed after we inline all the clones, but make it internal so we won't confuse ourself. */ @@ -354,9 +356,7 @@ save_inline_function_body (struct cgraph_node *node) DECL_COMDAT_GROUP (first_clone->symbol.decl) = NULL_TREE; TREE_PUBLIC (first_clone->symbol.decl) = 0; DECL_COMDAT (first_clone->symbol.decl) = 0; - VEC_free (ipa_opt_pass, heap, - first_clone->ipa_transforms_to_apply); - first_clone->ipa_transforms_to_apply = NULL; + first_clone->ipa_transforms_to_apply.release (); /* When doing recursive inlining, the clone may become unnecessary. This is possible i.e. in the case when the recursive function is proved to be @@ -381,7 +381,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)