aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-02-08 23:04:22 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2007-02-08 22:04:22 +0000
commitff39b79b8fe48e0f47c2798b71732250264baaa7 (patch)
tree005a5588bd4009ec67f5c701943e2dd2382287ae /gcc/tree-cfg.c
parentb3f7d793a97a705948e5b86b8987c4ac685ed247 (diff)
downloadgcc-ff39b79b8fe48e0f47c2798b71732250264baaa7.zip
gcc-ff39b79b8fe48e0f47c2798b71732250264baaa7.tar.gz
gcc-ff39b79b8fe48e0f47c2798b71732250264baaa7.tar.bz2
tree-cfg.c (bsi_replace): Shortcut when replacing the statement with the same one; always update histograms.
* tree-cfg.c (bsi_replace): Shortcut when replacing the statement with the same one; always update histograms. From-SVN: r121724
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index d979459..e3e2134 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2840,6 +2840,8 @@ bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool update_eh_info)
int eh_region;
tree orig_stmt = bsi_stmt (*bsi);
+ if (stmt == orig_stmt)
+ return;
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (orig_stmt));
set_bb_for_stmt (stmt, bsi->bb);
@@ -2852,11 +2854,11 @@ bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool update_eh_info)
{
remove_stmt_from_eh_region (orig_stmt);
add_stmt_to_eh_region (stmt, eh_region);
- gimple_duplicate_stmt_histograms (cfun, stmt, cfun, orig_stmt);
- gimple_remove_stmt_histograms (cfun, orig_stmt);
}
}
+ gimple_duplicate_stmt_histograms (cfun, stmt, cfun, orig_stmt);
+ gimple_remove_stmt_histograms (cfun, orig_stmt);
delink_stmt_imm_use (orig_stmt);
*bsi_stmt_ptr (*bsi) = stmt;
mark_stmt_modified (stmt);