diff options
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 7e1363e9aef..4925d452726 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5695,14 +5695,15 @@ compute_phi_arg_on_exit (edge exit, tree stmts, tree op) { for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi)) { - bsi_insert_after (&bsi, tsi_stmt (tsi), BSI_NEW_STMT); - protect_loop_closed_ssa_form (exit, bsi_stmt (bsi)); + tree stmt = tsi_stmt (tsi); + bsi_insert_before (&bsi, stmt, BSI_SAME_STMT); + protect_loop_closed_ssa_form (exit, stmt); } } else { - bsi_insert_after (&bsi, stmts, BSI_NEW_STMT); - protect_loop_closed_ssa_form (exit, bsi_stmt (bsi)); + bsi_insert_before (&bsi, stmts, BSI_SAME_STMT); + protect_loop_closed_ssa_form (exit, stmts); } if (!op) @@ -5719,7 +5720,7 @@ compute_phi_arg_on_exit (edge exit, tree stmts, tree op) stmt = build2 (MODIFY_EXPR, TREE_TYPE (op), def, op); SSA_NAME_DEF_STMT (def) = stmt; - bsi_insert_after (&bsi, stmt, BSI_CONTINUE_LINKING); + bsi_insert_before (&bsi, stmt, BSI_SAME_STMT); } } } |