diff options
author | Richard Biener <rguenther@suse.de> | 2015-03-12 08:48:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-03-12 08:48:32 +0000 |
commit | b13c907ab30853cd117ee0fbcad4dd2629633baa (patch) | |
tree | 96cf4512c45734f7ca303c37449d8c368c5cb258 /gcc/tree-cfg.c | |
parent | cb599e7d76f71c8bcb7f9484916f6be88527f8a6 (diff) | |
download | gcc-b13c907ab30853cd117ee0fbcad4dd2629633baa.zip gcc-b13c907ab30853cd117ee0fbcad4dd2629633baa.tar.gz gcc-b13c907ab30853cd117ee0fbcad4dd2629633baa.tar.bz2 |
tree-cfg.c (gimple_split_block): Remove loop finding stmt to split on.
2015-03-12 Richard Biener <rguenther@suse.de>
* tree-cfg.c (gimple_split_block): Remove loop finding stmt
to split on.
* omp-low.c (expand_omp_taskreg): Split block before removing
the stmt.
(expand_omp_target): Likewise.
* ubsan.c (ubsan_expand_null_ifn): Adjust stmt if we replaced it.
* tree-parloops.c (create_call_for_reduction_1): Pass a proper
stmt to split_block.
From-SVN: r221377
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 006bc08..e1bc143 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -5683,7 +5683,6 @@ gimple_split_block (basic_block bb, void *stmt) { gimple_stmt_iterator gsi; gimple_stmt_iterator gsi_tgt; - gimple act; gimple_seq list; basic_block new_bb; edge e; @@ -5697,26 +5696,16 @@ gimple_split_block (basic_block bb, void *stmt) FOR_EACH_EDGE (e, ei, new_bb->succs) e->src = new_bb; - if (stmt && gimple_code ((gimple) stmt) == GIMPLE_LABEL) - stmt = NULL; - - /* Move everything from GSI to the new basic block. */ - for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + /* Get a stmt iterator pointing to the first stmt to move. */ + if (!stmt || gimple_code ((gimple) stmt) == GIMPLE_LABEL) + gsi = gsi_after_labels (bb); + else { - act = gsi_stmt (gsi); - if (gimple_code (act) == GIMPLE_LABEL) - continue; - - if (!stmt) - break; - - if (stmt == act) - { - gsi_next (&gsi); - break; - } + gsi = gsi_for_stmt ((gimple) stmt); + gsi_next (&gsi); } - + + /* Move everything from GSI to the new basic block. */ if (gsi_end_p (gsi)) return new_bb; |