summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-13 17:31:30 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-13 17:31:30 +0000
commit3dd775fb895cffb77ac74098a74e9fca28edaf79 (patch)
treef68062e9cfe09046337dc976767a5f7938462868 /gcc/tree-inline.c
parent84014c53e113ab540befd1eceb8598d28a323ab3 (diff)
parent34a5d2a56d4b0a0ea74339c985c919aabfc530a4 (diff)
downloadgcc-3dd775fb895cffb77ac74098a74e9fca28edaf79.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 4ae912a875a..28aac19b9af 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1271,7 +1271,9 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
|| ! SSA_NAME_VAR (retval)
|| TREE_CODE (SSA_NAME_VAR (retval)) != RESULT_DECL)))
{
- copy = gimple_build_assign (id->retvar, retval);
+ copy = gimple_build_assign (id->do_not_unshare
+ ? id->retvar : unshare_expr (id->retvar),
+ retval);
/* id->retvar is already substituted. Skip it on later remapping. */
skip_first = true;
}
@@ -1790,7 +1792,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
{
edge->frequency = new_freq;
if (dump_file
- && profile_status_for_function (cfun) != PROFILE_ABSENT
+ && profile_status_for_fn (cfun) != PROFILE_ABSENT
&& (edge_freq > edge->frequency + 10
|| edge_freq < edge->frequency - 10))
{
@@ -2206,7 +2208,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count)
init_empty_tree_cfg ();
- profile_status_for_function (cfun) = profile_status_for_function (src_cfun);
+ profile_status_for_fn (cfun) = profile_status_for_fn (src_cfun);
ENTRY_BLOCK_PTR_FOR_FN (cfun)->count =
(ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count * count_scale /
REG_BR_PROB_BASE);
@@ -2486,7 +2488,7 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale,
new_bb->loop_father = entry_block_map->loop_father;
}
- last = last_basic_block;
+ last = last_basic_block_for_fn (cfun);
/* Now that we've duplicated the blocks, duplicate their edges. */
bool can_make_abormal_goto
@@ -2542,15 +2544,16 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale,
/* Zero out AUX fields of newly created block during EH edge
insertion. */
- for (; last < last_basic_block; last++)
+ for (; last < last_basic_block_for_fn (cfun); last++)
{
if (need_debug_cleanup)
- maybe_move_debug_stmts_to_successors (id, BASIC_BLOCK (last));
- BASIC_BLOCK (last)->aux = NULL;
+ maybe_move_debug_stmts_to_successors (id,
+ BASIC_BLOCK_FOR_FN (cfun, last));
+ BASIC_BLOCK_FOR_FN (cfun, last)->aux = NULL;
/* Update call edge destinations. This can not be done before loop
info is updated, because we may split basic blocks. */
if (id->transform_call_graph_edges == CB_CGE_DUPLICATE)
- redirect_all_calls (id, BASIC_BLOCK (last));
+ redirect_all_calls (id, BASIC_BLOCK_FOR_FN (cfun, last));
}
entry_block_map->aux = NULL;
exit_block_map->aux = NULL;
@@ -4441,11 +4444,11 @@ static void
fold_marked_statements (int first, struct pointer_set_t *statements)
{
for (; first < n_basic_blocks_for_fn (cfun); first++)
- if (BASIC_BLOCK (first))
+ if (BASIC_BLOCK_FOR_FN (cfun, first))
{
gimple_stmt_iterator gsi;
- for (gsi = gsi_start_bb (BASIC_BLOCK (first));
+ for (gsi = gsi_start_bb (BASIC_BLOCK_FOR_FN (cfun, first));
!gsi_end_p (gsi);
gsi_next (&gsi))
if (pointer_set_contains (statements, gsi_stmt (gsi)))
@@ -4471,7 +4474,7 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
break;
}
if (gsi_end_p (i2))
- i2 = gsi_start_bb (BASIC_BLOCK (first));
+ i2 = gsi_start_bb (BASIC_BLOCK_FOR_FN (cfun, first));
else
gsi_next (&i2);
while (1)
@@ -4495,7 +4498,8 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
is mood anyway. */
if (maybe_clean_or_replace_eh_stmt (old_stmt,
new_stmt))
- gimple_purge_dead_eh_edges (BASIC_BLOCK (first));
+ gimple_purge_dead_eh_edges (
+ BASIC_BLOCK_FOR_FN (cfun, first));
break;
}
gsi_next (&i2);
@@ -4515,7 +4519,8 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
new_stmt);
if (maybe_clean_or_replace_eh_stmt (old_stmt, new_stmt))
- gimple_purge_dead_eh_edges (BASIC_BLOCK (first));
+ gimple_purge_dead_eh_edges (BASIC_BLOCK_FOR_FN (cfun,
+ first));
}
}
}
@@ -4564,7 +4569,7 @@ optimize_inline_calls (tree fn)
will split id->current_basic_block, and the new blocks will
follow it; we'll trudge through them, processing their CALL_EXPRs
along the way. */
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
inlined_p |= gimple_expand_calls_inline (bb, &id);
pop_gimplify_context (NULL);
@@ -4607,7 +4612,8 @@ optimize_inline_calls (tree fn)
| TODO_cleanup_cfg
| (gimple_in_ssa_p (cfun) ? TODO_remove_unused_locals : 0)
| (gimple_in_ssa_p (cfun) ? TODO_update_address_taken : 0)
- | (profile_status != PROFILE_ABSENT ? TODO_rebuild_frequencies : 0));
+ | (profile_status_for_fn (cfun) != PROFILE_ABSENT
+ ? TODO_rebuild_frequencies : 0));
}
/* Passed to walk_tree. Copies the node pointed to, if appropriate. */