diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-11 13:13:37 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-11 13:13:37 +0000 |
commit | 469679aba0e296a3f7635b30532d76ea6a433861 (patch) | |
tree | 7528e0c14251773ead6e3aa9eaaf90a59556ee1d /gcc/ipa-inline.c | |
parent | df738c1f721fd7482b0d2c122f8007b08c79f86a (diff) | |
download | gcc-469679aba0e296a3f7635b30532d76ea6a433861.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index ceadb23261f..fa91cbd96dc 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)) { |