From 54746cd36c1a1a494022f85f6d442f9320f680dc Mon Sep 17 00:00:00 2001 From: hubicka Date: Thu, 8 Feb 2007 22:04:22 +0000 Subject: [PATCH] * tree-cfg.c (bsi_replace): Shortcut when replacing the statement with the same one; always update histograms. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121724 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-cfg.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0c7db90eccb..3a51bb5eaa8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-02-08 Jan Hubicka + + * tree-cfg.c (bsi_replace): Shortcut when replacing the statement with + the same one; always update histograms. + 2007-02-08 Diego Novillo * passes.c (init_optimization_passes): Tidy comment. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index d9794592cf6..e3e21342b00 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); -- 2.11.4.GIT