X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-inline.c;h=97c9261b4690612eee996ed2cbdcec8e845c1d21;hb=d0aaf3990d011abe5d7c65905f240a60d2fdccb6;hp=e62c5c1e7925f748d74ff4c4370f8cc98383f922;hpb=da50fe8f588a6dc5f7ebabd347d87741f06f7120;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index e62c5c1e792..97c9261b469 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -600,6 +600,7 @@ copy_statement_list (tree *tp) new_tree = alloc_stmt_list (); ni = tsi_start (new_tree); oi = tsi_start (*tp); + TREE_TYPE (new_tree) = TREE_TYPE (*tp); *tp = new_tree; for (; !tsi_end_p (oi); tsi_next (&oi)) @@ -1828,7 +1829,8 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id) new_arg = force_gimple_operand (new_arg, &stmts, true, NULL); gsi_insert_seq_on_edge_immediate (new_edge, stmts); } - add_phi_arg (new_phi, new_arg, new_edge); + add_phi_arg (new_phi, new_arg, new_edge, + gimple_phi_arg_location_from_edge (phi, old_edge)); } } } @@ -4752,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 @@ -4783,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; }