diff options
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 3105aec8255..0c6ff93d625 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -859,9 +859,15 @@ symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee, && callee && callee->decl && !gimple_check_call_matching_types (call_stmt, callee->decl, false)) - edge->call_stmt_cannot_inline_p = true; + { + edge->inline_failed = CIF_MISMATCHED_ARGUMENTS; + edge->call_stmt_cannot_inline_p = true; + } else - edge->call_stmt_cannot_inline_p = false; + { + edge->inline_failed = CIF_FUNCTION_NOT_CONSIDERED; + edge->call_stmt_cannot_inline_p = false; + } edge->indirect_info = NULL; edge->indirect_inlining_edge = 0; @@ -1240,10 +1246,12 @@ cgraph_edge::make_direct (cgraph_node *callee) /* Insert to callers list of the new callee. */ edge->set_callee (callee); - if (call_stmt) - call_stmt_cannot_inline_p - = !gimple_check_call_matching_types (call_stmt, callee->decl, - false); + if (call_stmt + && !gimple_check_call_matching_types (call_stmt, callee->decl, false)) + { + call_stmt_cannot_inline_p = true; + inline_failed = CIF_MISMATCHED_ARGUMENTS; + } /* We need to re-determine the inlining status of the edge. */ initialize_inline_failed (edge); @@ -1996,6 +2004,8 @@ cgraph_edge::dump_edge_flags (FILE *f) fprintf (f, "(speculative) "); if (!inline_failed) fprintf (f, "(inlined) "); + if (call_stmt_cannot_inline_p) + fprintf (f, "(call_stmt_cannot_inline_p) "); if (indirect_inlining_edge) fprintf (f, "(indirect_inlining) "); if (count) @@ -2279,7 +2289,7 @@ cgraph_node::can_be_local_p (void) } /* Call callback on cgraph_node, thunks and aliases associated to cgraph_node. - When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are + When INCLUDE_OVERWRITABLE is false, overwritable symbols are skipped. When EXCLUDE_VIRTUAL_THUNKS is true, virtual thunks are skipped. */ bool @@ -2291,9 +2301,14 @@ cgraph_node::call_for_symbol_thunks_and_aliases (bool (*callback) { cgraph_edge *e; ipa_ref *ref; + enum availability avail = AVAIL_AVAILABLE; - if (callback (this, data)) - return true; + if (include_overwritable + || (avail = get_availability ()) > AVAIL_INTERPOSABLE) + { + if (callback (this, data)) + return true; + } FOR_EACH_ALIAS (this, ref) { cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring); @@ -2304,7 +2319,7 @@ cgraph_node::call_for_symbol_thunks_and_aliases (bool (*callback) exclude_virtual_thunks)) return true; } - if (get_availability () <= AVAIL_INTERPOSABLE) + if (avail <= AVAIL_INTERPOSABLE) return false; for (e = callers; e; e = e->next_caller) if (e->caller->thunk.thunk_p |