From ea99e0becf7057b7112a267b55e39e9b8c24db13 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 11 Jan 2006 14:13:37 +0100 Subject: cgraph.c (cgraph_insert_node_to_hashtable): New function. * cgraph.c (cgraph_insert_node_to_hashtable): New function. * cgraph.h (cgraph_node): Add inline_decl. (cgraph_insert_node_to_hashtable): Declare. (save_inline_function_body): Declare. * cgraphunit.c (verify_cgraph_node): Inline edges might point to inline clones. (cgraph_preserve_function_body_p): Do not presrve when dump is enabled. (cgraph_function_versioning): Update call of tree_function_versioning. (save_inline_function_body): New function. * function.h (struct function): Kill saved_eh, saved_cfg, saved_args, saved_static_chain_decl, saved_blocks and saved-unexpanded_var_list. * ipa-inline.c (cgraph_mark_inline_edge): Look for inline clones. (cgraph_default_inline_p): Likewise. (cgraph_decide_inlining_incrementally): Likewise. * tree-inline.c (inline_data): Kill saving_p add update_clones_p. (copy_bb): Kill saving; do updating of clones. (copy_cfg_body): Kill saving. (initialize_inlined-parameters): Likewise. (expand_call_inline): Likewise. (save_body): Kill. (tree_function_versioning): New parameter "update_clones". (inlining_p): Kill saving. * tree-inline.h (tree_function_versioning): Update prototype. * tree-optimize.c (tree_rest_of_compilation): Use clonning instead of saving. From-SVN: r109580 --- gcc/ipa-inline.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gcc/ipa-inline.c') diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index ceadb23..fa91cbd 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -158,6 +158,9 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original) int old_insns = 0, new_insns = 0; struct cgraph_node *to = NULL, *what; + if (e->callee->inline_decl) + cgraph_redirect_edge_callee (e, cgraph_node (e->callee->inline_decl)); + gcc_assert (e->inline_failed); e->inline_failed = NULL; @@ -283,21 +286,25 @@ cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what, bool cgraph_default_inline_p (struct cgraph_node *n, const char **reason) { - if (!DECL_INLINE (n->decl)) + tree decl = n->decl; + + if (n->inline_decl) + decl = n->inline_decl; + if (!DECL_INLINE (decl)) { if (reason) *reason = N_("function not inlinable"); return false; } - if (!DECL_SAVED_TREE (n->decl)) + if (!DECL_STRUCT_FUNCTION (decl)->cfg) { if (reason) *reason = N_("function body not available"); return false; } - if (DECL_DECLARED_INLINE_P (n->decl)) + if (DECL_DECLARED_INLINE_P (decl)) { if (n->global.insns >= MAX_INLINE_INSNS_SINGLE) { @@ -1046,7 +1053,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, bool early) && !cgraph_recursive_inlining_p (node, e->callee, &e->inline_failed) /* ??? It is possible that renaming variable removed the function body in duplicate_decls. See gcc.c-torture/compile/20011119-2.c */ - && DECL_SAVED_TREE (e->callee->decl)) + && (DECL_SAVED_TREE (e->callee->decl) || e->callee->inline_decl)) { if (dump_file && early) { @@ -1069,7 +1076,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, bool early) || (cgraph_estimate_size_after_inlining (1, e->caller, node) <= e->caller->global.insns)) && cgraph_check_inline_limits (node, e->callee, &e->inline_failed) - && DECL_SAVED_TREE (e->callee->decl)) + && (DECL_SAVED_TREE (e->callee->decl) || e->callee->inline_decl)) { if (cgraph_default_inline_p (e->callee, &failed_reason)) { -- cgit v1.1