aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2016-05-03 21:05:31 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-05-03 19:05:31 +0000
commit1a0bf5e11baddeb3b12e02d85b5e2504ce151abd (patch)
treefa1518ec23a4f9f2df062d54c970f14311ba7cbc /gcc/ipa-inline.c
parent8b38916ad4fe0b878b12c9a42d6983ac09440485 (diff)
downloadgcc-1a0bf5e11baddeb3b12e02d85b5e2504ce151abd.zip
gcc-1a0bf5e11baddeb3b12e02d85b5e2504ce151abd.tar.gz
gcc-1a0bf5e11baddeb3b12e02d85b5e2504ce151abd.tar.bz2
cgraph.c (symbol_table::create_edge): Set inline_failed.
* cgraph.c (symbol_table::create_edge): Set inline_failed. (cgraph_edge::make_direct): Likewise. (cgraph_edge::dump_edge_flags): Dump call_stmt_cannot_inline_p. * cgraphclones.c (duplicate_thunk_for_node): Set inline_failed. * cif-code.def (CIF_LTO_MISMATCHED_DECLARATIONS): New code (CIF_THUNK): New code. * ipa-inline-analysis.c (initialize_inline_failed): Preserve CIF_FINAL_ERROR codes; do not deal with call_stmt_cannot_inline_p. (compute_inline_parameters): Set inline_failed for thunks. (inline_analyze_function): Cleanup. * ipa-inline.c (can_inline_edge_p): Do not deal with call_stmt_cannot_inline_p. (can_early_inline_edge_p): Likewise. (early_inliner): Initialize inline_failed. * lto-cgraph.c (lto_output_edge): Sanity check inline_failed. * lto-symtab.c (lto_cgraph_replace_node): Initialize inline_failed. From-SVN: r235839
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index d520c55..a5c5c9b 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -335,12 +335,10 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,
e->inline_failed = CIF_OVERWRITABLE;
inlinable = false;
}
+ /* All edges with call_stmt_cannot_inline_p should have inline_failed
+ initialized to one of FINAL_ERROR reasons. */
else if (e->call_stmt_cannot_inline_p)
- {
- if (e->inline_failed != CIF_FUNCTION_NOT_OPTIMIZED)
- e->inline_failed = e->caller->thunk.thunk_p ? CIF_THUNK : CIF_MISMATCHED_ARGUMENTS;
- inlinable = false;
- }
+ gcc_unreachable ();
/* Don't inline if the functions have different EH personalities. */
else if (DECL_FUNCTION_PERSONALITY (caller->decl)
&& DECL_FUNCTION_PERSONALITY (callee->decl)
@@ -529,6 +527,8 @@ can_early_inline_edge_p (struct cgraph_edge *e)
/* Early inliner might get called at WPA stage when IPA pass adds new
function. In this case we can not really do any of early inlining
because function bodies are missing. */
+ if (cgraph_inline_failed_type (e->inline_failed) == CIF_FINAL_ERROR)
+ return false;
if (!gimple_has_body_p (callee->decl))
{
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
@@ -2741,7 +2741,10 @@ early_inliner (function *fun)
if (edge->callee->decl
&& !gimple_check_call_matching_types (
edge->call_stmt, edge->callee->decl, false))
- edge->call_stmt_cannot_inline_p = true;
+ {
+ edge->inline_failed = CIF_MISMATCHED_ARGUMENTS;
+ edge->call_stmt_cannot_inline_p = true;
+ }
}
if (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS) - 1)
inline_update_overall_summary (node);