aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2004-10-18 18:01:10 +0000
committerDiego Novillo <dnovillo@redhat.com>2004-10-18 18:01:10 +0000
commit784886594aa9f442fa0f1fd1c47c1c2b73f2ae0b (patch)
tree65fa2dda5884adcb69fca3aa5ca69487f2799ab4 /gcc/tree-ssa.c
parentfc5d78e3dbeb76c1fd47c05d24c181e934022cb0 (diff)
* tree-cfg.c (bsi_for_stmt): Rename from stmt_for_bsi.
Update all callers. * tree-ssa.c (replace_immediate_uses): Call bsi_for_stmt. Don't call fold_stmt more than once, use bsi_replace. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@89234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 4362e01aff8..7f73bcf6e73 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1105,20 +1105,9 @@ replace_immediate_uses (tree var, tree repl)
fold_stmt (&tmp);
if (tmp != stmt)
{
- basic_block bb = bb_for_stmt (stmt);
- block_stmt_iterator si;
-
- /* Start iterating at the start of the basic block
- holding STMT until we reach it. This is slow, but
- it's the only way to get a statement pointer
- reliably. */
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- if (bsi_stmt (si) == stmt)
- {
- fold_stmt (bsi_stmt_ptr (si));
- stmt = bsi_stmt (si);
- break;
- }
+ block_stmt_iterator si = bsi_for_stmt (stmt);
+ bsi_replace (&si, tmp, true);
+ stmt = bsi_stmt (si);
}
}