diff options
author | Xinliang David Li <davidxl@google.com> | 2009-08-12 16:51:41 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@gcc.gnu.org> | 2009-08-12 16:51:41 +0000 |
commit | 6eb29714e4e42bb0ce53759b2567a71b96cd5c8e (patch) | |
tree | 169e66302796b1a698328523a598d07c824939db /gcc/tree-inline.c | |
parent | e8e76230ed27bb3a942c0db135089f905c43684f (diff) | |
download | gcc-6eb29714e4e42bb0ce53759b2567a71b96cd5c8e.zip gcc-6eb29714e4e42bb0ce53759b2567a71b96cd5c8e.tar.gz gcc-6eb29714e4e42bb0ce53759b2567a71b96cd5c8e.tar.bz2 |
Fix to PR41012
From-SVN: r150703
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 3b07aaa..97c9261 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4754,9 +4754,10 @@ build_duplicate_type (tree type) } /* Return whether it is safe to inline a function because it used different - target specific options or different optimization options. */ + target specific options or call site actual types mismatch parameter types. + E is the call edge to be checked. */ bool -tree_can_inline_p (tree caller, tree callee) +tree_can_inline_p (struct cgraph_edge *e) { #if 0 /* This causes a regression in SPEC in that it prevents a cold function from @@ -4785,7 +4786,25 @@ tree_can_inline_p (tree caller, tree callee) return false; } #endif + tree caller, callee; + + caller = e->caller->decl; + callee = e->callee->decl; /* Allow the backend to decide if inlining is ok. */ - return targetm.target_option.can_inline_p (caller, callee); + if (!targetm.target_option.can_inline_p (caller, callee)) + { + e->inline_failed = CIF_TARGET_OPTION_MISMATCH; + gimple_call_set_cannot_inline (e->call_stmt, true); + return false; + } + + if (!gimple_check_call_args (e->call_stmt)) + { + e->inline_failed = CIF_MISMATCHED_ARGUMENTS; + gimple_call_set_cannot_inline (e->call_stmt, true); + return false; + } + + return true; } |