summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-07 06:05:11 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-07 06:05:11 +0000
commitebebeee379dd8b985e6877e56bc124041907038b (patch)
tree32a2ce6c6b8ce5f11172be301cb81225d5d5cbac /gcc/tree-inline.c
parent588bbfff28d00a54a71f2d751fb75767b6b1b3cb (diff)
downloadgcc-ebebeee379dd8b985e6877e56bc124041907038b.tar.gz
2009-04-07 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r145646 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@145649 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 609a0818ad7..e1e1f1154d1 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1297,6 +1297,14 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
else
walk_gimple_op (copy, remap_gimple_op_r, &wi);
+ /* Clear the copied virtual operands. We are not remapping them here
+ but are going to recreate them from scratch. */
+ if (gimple_has_mem_ops (copy))
+ {
+ gimple_set_vdef (copy, NULL_TREE);
+ gimple_set_vuse (copy, NULL_TREE);
+ }
+
/* We have to handle EH region remapping of GIMPLE_RESX specially because
the region number is not an operand. */
if (gimple_code (stmt) == GIMPLE_RESX && id->eh_region_offset)
@@ -3410,6 +3418,9 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
pointer_map_destroy (id->decl_map);
id->decl_map = st;
+ /* Unlink the calls virtual operands before replacing it. */
+ unlink_stmt_vdef (stmt);
+
/* If the inlined function returns a result that we care about,
substitute the GIMPLE_CALL with an assignment of the return
variable to the LHS of the call. That is, if STMT was
@@ -3420,10 +3431,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
stmt = gimple_build_assign (gimple_call_lhs (stmt), use_retvar);
gsi_replace (&stmt_gsi, stmt, false);
if (gimple_in_ssa_p (cfun))
- {
- update_stmt (stmt);
- mark_symbols_for_renaming (stmt);
- }
+ mark_symbols_for_renaming (stmt);
maybe_clean_or_replace_eh_stmt (old_stmt, stmt);
}
else
@@ -3443,7 +3451,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
undefined via a move. */
stmt = gimple_build_assign (gimple_call_lhs (stmt), def);
gsi_replace (&stmt_gsi, stmt, true);
- update_stmt (stmt);
}
else
{
@@ -4451,28 +4458,16 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
/* Clean up. */
pointer_map_destroy (id.decl_map);
+ free_dominance_info (CDI_DOMINATORS);
+ free_dominance_info (CDI_POST_DOMINATORS);
if (!update_clones)
{
fold_marked_statements (0, id.statements_to_fold);
pointer_set_destroy (id.statements_to_fold);
fold_cond_expr_cond ();
- }
- if (gimple_in_ssa_p (cfun))
- {
- free_dominance_info (CDI_DOMINATORS);
- free_dominance_info (CDI_POST_DOMINATORS);
- if (!update_clones)
- delete_unreachable_blocks ();
+ delete_unreachable_blocks ();
update_ssa (TODO_update_ssa);
- if (!update_clones)
- {
- fold_cond_expr_cond ();
- if (need_ssa_update_p ())
- update_ssa (TODO_update_ssa);
- }
}
- free_dominance_info (CDI_DOMINATORS);
- free_dominance_info (CDI_POST_DOMINATORS);
VEC_free (gimple, heap, init_stmts);
pop_cfun ();
current_function_decl = old_current_function_decl;