aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2010-06-22 18:21:25 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-06-22 18:21:25 +0000
commit8d2adc244b117d1560a75caf39b0698eeb6c96ef (patch)
treee85874c9f8f854e3483015176601bba12e52e10c /gcc/cgraphunit.c
parentca3e07b4edd28f5c643dd4a601d51db135fde67b (diff)
downloadgcc-8d2adc244b117d1560a75caf39b0698eeb6c96ef.zip
gcc-8d2adc244b117d1560a75caf39b0698eeb6c96ef.tar.gz
gcc-8d2adc244b117d1560a75caf39b0698eeb6c96ef.tar.bz2
cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Chain the new statement and adjust VDEF only if necessary.
* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Chain the new statement and adjust VDEF only if necessary. Remove superfluous call to maybe_clean_or_replace_eh_stmt. * gimple.c (gimple_call_copy_skip_args): Use gimple_call_copy_flags to copy the flags. * gimple-iterator.c (gsi_replace): Clear BB of old statement here... * tree-inline.c (copy_bb): ...and not there. From-SVN: r161221
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 54752ed..0a1622e 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2345,7 +2345,6 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
{
tree decl = gimple_call_fndecl (e->call_stmt);
gimple new_stmt;
- gimple_stmt_iterator gsi;
#ifdef ENABLE_CHECKING
struct cgraph_node *node;
#endif
@@ -2367,29 +2366,34 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
cgraph_node_name (e->callee), e->callee->uid);
print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
if (e->callee->clone.combined_args_to_skip)
- {
- fprintf (cgraph_dump_file, " combined args to skip: ");
- dump_bitmap (cgraph_dump_file, e->callee->clone.combined_args_to_skip);
+ {
+ fprintf (cgraph_dump_file, " combined args to skip: ");
+ dump_bitmap (cgraph_dump_file,
+ e->callee->clone.combined_args_to_skip);
}
}
if (e->callee->clone.combined_args_to_skip)
- new_stmt = gimple_call_copy_skip_args (e->call_stmt,
- e->callee->clone.combined_args_to_skip);
+ {
+ gimple_stmt_iterator gsi;
+
+ new_stmt
+ = gimple_call_copy_skip_args (e->call_stmt,
+ e->callee->clone.combined_args_to_skip);
+
+ if (gimple_vdef (new_stmt)
+ && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)
+ SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
+
+ gsi = gsi_for_stmt (e->call_stmt);
+ gsi_replace (&gsi, new_stmt, true);
+ }
else
new_stmt = e->call_stmt;
- if (gimple_vdef (new_stmt)
- && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)
- SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
- gimple_call_set_fndecl (new_stmt, e->callee->decl);
- gsi = gsi_for_stmt (e->call_stmt);
- gsi_replace (&gsi, new_stmt, true);
+ gimple_call_set_fndecl (new_stmt, e->callee->decl);
update_stmt (new_stmt);
- /* Update EH information too, just in case. */
- maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt);
-
cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt, new_stmt);
if (cgraph_dump_file)