+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.
+
2015-03-12 Tom de Vries <tom@codesourcery.com>
PR rtl-optimization/64895
stmt = gsi_stmt (gsi);
gcc_assert (stmt && (gimple_code (stmt) == GIMPLE_OMP_PARALLEL
|| gimple_code (stmt) == GIMPLE_OMP_TASK));
- gsi_remove (&gsi, true);
e = split_block (entry_bb, stmt);
+ gsi_remove (&gsi, true);
entry_bb = e->dest;
single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
stmt = gsi_stmt (gsi);
gcc_assert (stmt
&& gimple_code (stmt) == gimple_code (entry_stmt));
- gsi_remove (&gsi, true);
e = split_block (entry_bb, stmt);
+ gsi_remove (&gsi, true);
entry_bb = e->dest;
single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
{
gimple_stmt_iterator gsi;
gimple_stmt_iterator gsi_tgt;
- gimple act;
gimple_seq list;
basic_block new_bb;
edge e;
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;
/* Create phi node. */
bb = clsn_data->load_bb;
- e = split_block (bb, t);
+ gsi = gsi_last_bb (bb);
+ e = split_block (bb, gsi_stmt (gsi));
new_bb = e->dest;
tmp_load = create_tmp_var (TREE_TYPE (TREE_TYPE (addr)));
/* Replace the UBSAN_NULL with a GIMPLE_COND stmt. */
gsi_replace (&gsi, g, false);
+ stmt = g;
}
if (check_align)