summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-12 16:51:41 +0000
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-12 16:51:41 +0000
commit19bcf5214614bfc4322ffbe3d93c2fbcf6c22c26 (patch)
tree169e66302796b1a698328523a598d07c824939db /gcc/tree-inline.c
parentf44e3dd1108813524120827780a45f23196a4802 (diff)
downloadgcc-19bcf5214614bfc4322ffbe3d93c2fbcf6c22c26.tar.gz
Fix to PR41012
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150703 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 3b07aaa36ba..97c9261b469 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;
}