diff options
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 6d74c1f71b7..b7f1597691a 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -954,6 +954,14 @@ cgraph_decide_inlining_of_small_functions (void) } continue; } + if (!tree_can_inline_p (edge->caller->decl, edge->callee->decl)) + { + CALL_STMT_CANNOT_INLINE_P (edge->call_stmt) = true; + edge->inline_failed = N_("target specific option mismatch"); + if (dump_file) + fprintf (dump_file, " inline_failed:%s.\n", edge->inline_failed); + continue; + } if (cgraph_recursive_inlining_p (edge->caller, edge->callee, &edge->inline_failed)) { @@ -1098,6 +1106,11 @@ cgraph_decide_inlining (void) if (cgraph_recursive_inlining_p (e->caller, e->callee, &e->inline_failed)) continue; + if (!tree_can_inline_p (e->caller->decl, e->callee->decl)) + { + CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true; + continue; + } cgraph_mark_inline_edge (e, true); if (dump_file) fprintf (dump_file, @@ -1322,6 +1335,17 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, } continue; } + if (!tree_can_inline_p (node->decl, e->callee->decl)) + { + CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true; + if (dump_file) + { + indent_to (dump_file, depth); + fprintf (dump_file, + "Not inlining: Target specific option mismatch.\n"); + } + continue; + } if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->decl)) != gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->callee->decl))) { @@ -1418,6 +1442,17 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, } continue; } + if (!tree_can_inline_p (node->decl, e->callee->decl)) + { + CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true; + if (dump_file) + { + indent_to (dump_file, depth); + fprintf (dump_file, + "Not inlining: Target specific option mismatch.\n"); + } + continue; + } if (cgraph_default_inline_p (e->callee, &failed_reason)) inlined |= try_inline (e, mode, depth); else if (!flag_unit_at_a_time) |