summaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-04 02:52:36 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-04 02:52:36 +0000
commitf105beb6e1491b41507146aae95e4dfc561eba1d (patch)
treebd19bf2cb69c4a29adc78e508ba6a33b8d236503 /gcc/tree-sra.c
parent2d0bca8baeaa6b8003cb20f239ce653a41635154 (diff)
downloadgcc-f105beb6e1491b41507146aae95e4dfc561eba1d.tar.gz
PR tree-optimization/16341
* tree-sra.c (sra_walk_function): Increment to next stmt before processing the current stmt. (sra_insert_after): Always use BSI_SAME_STMT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84070 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 0f04fcb2a2e..f315ad90b11 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -828,13 +828,13 @@ static void
sra_walk_function (const struct sra_walk_fns *fns)
{
basic_block bb;
- block_stmt_iterator si;
+ block_stmt_iterator si, ni;
/* ??? Phase 4 could derive some benefit to walking the function in
dominator tree order. */
FOR_EACH_BB (bb)
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = bsi_start (bb); !bsi_end_p (si); si = ni)
{
tree stmt, t;
stmt_ann_t ann;
@@ -842,6 +842,9 @@ sra_walk_function (const struct sra_walk_fns *fns)
stmt = bsi_stmt (si);
ann = stmt_ann (stmt);
+ ni = si;
+ bsi_next (&ni);
+
/* If the statement has no virtual operands, then it doesn't
make any structure references that we care about. */
if (NUM_V_MAY_DEFS (V_MAY_DEF_OPS (ann)) == 0
@@ -1616,7 +1619,7 @@ sra_insert_after (block_stmt_iterator *bsi, tree list)
if (stmt_ends_bb_p (stmt))
insert_edge_copies (list, bsi->bb);
else
- bsi_insert_after (bsi, list, BSI_CONTINUE_LINKING);
+ bsi_insert_after (bsi, list, BSI_SAME_STMT);
}
/* Similarly, but replace the statement at BSI. */