summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-20 19:48:59 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-20 19:48:59 +0000
commita6d6017980f2183db0e159a632bb14d4c9653a5b (patch)
tree6e5c86ba08bd55d166385c9730c5ac85ac9810d0 /gcc/ipa-inline-transform.c
parent01ec5786f61e5404aa009dda193cde74b94d89d4 (diff)
downloadgcc-a6d6017980f2183db0e159a632bb14d4c9653a5b.tar.gz
PR lto/45375
* ipa-inline.c: Include lto-streamer.h (report_inline_failed_reason): Output source file differences and flags on optimization/target node mismatch. (can_inline_edge_p): Consider caller to be the outer inline function; be less restrictive about matching opimize and optimize_size attributes. (inline_account_function_p): Break out from ... (inline_small_functions): ... here. * ipa-inline-transform.c (clone_inlined_nodes): Use inline_account_function_p. (inline_call): Use optimize attribution; use inline_account_function_p. (inline_transform): Use opt_for_fn. * ipa-inline.h (inline_account_function_p): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219909 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 1c4b23a1ebc..235219dd82e 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -214,8 +214,10 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
cgraph_remove_unreachable_functions gets rid of them. */
gcc_assert (!e->callee->global.inlined_to);
e->callee->dissolve_same_comdat_group_list ();
- if (e->callee->definition && !DECL_EXTERNAL (e->callee->decl))
+ if (e->callee->definition
+ && inline_account_function_p (e->callee))
{
+ gcc_assert (!e->callee->alias);
if (overall_size)
*overall_size -= inline_summaries->get (e->callee)->size;
nfunctions_inlined++;
@@ -330,7 +332,7 @@ inline_call (struct cgraph_edge *e, bool update_original,
old_size = inline_summaries->get (to)->size;
inline_merge_summary (e);
- if (optimize)
+ if (opt_for_fn (e->caller->decl, optimize))
new_edges_found = ipa_propagate_indirect_call_infos (curr, new_edges);
if (update_overall_summary)
inline_update_overall_summary (to);
@@ -361,8 +363,7 @@ inline_call (struct cgraph_edge *e, bool update_original,
/* Account the change of overall unit size; external functions will be
removed and are thus not accounted. */
- if (overall_size
- && !DECL_EXTERNAL (to->decl))
+ if (overall_size && inline_account_function_p (to))
*overall_size += new_size - old_size;
ncalls_inlined++;
@@ -509,7 +510,7 @@ inline_transform (struct cgraph_node *node)
node->remove_all_references ();
timevar_push (TV_INTEGRATION);
- if (node->callees && (optimize || has_inline))
+ if (node->callees && (opt_for_fn (node->decl, optimize) || has_inline))
todo = optimize_inline_calls (current_function_decl);
timevar_pop (TV_INTEGRATION);