+2017-12-13 Alexandre Oliva <aoliva@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/83396
+ PR debug/83391
+ * tree-cfgcleanup.c (remove_forwarder_block): Keep after
+ labels debug stmts that can only appear after labels.
+
2017-12-13 Alexander Monakov <amonakov@ispras.ru>
PR rtl-optimization/82398
+2017-12-13 Alexandre Oliva <aoliva@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/83396
+ PR debug/83391
+ * gcc.dg/torture/pr83396.c: New test.
+ * g++.dg/torture/pr83391.C: New test.
+
2017-12-13 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/83393
defined labels and labels with an EH landing pad number to the
new block, so that the redirection of the abnormal edges works,
jump targets end up in a sane place and debug information for
- labels is retained. */
+ labels is retained.
+
+ While at that, move any debug stmts that appear before or in between
+ labels, but not those that can only appear after labels. */
gsi_to = gsi_start_bb (dest);
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
+ gsi = gsi_start_bb (bb);
+ gimple_stmt_iterator gsie = gsi_after_labels (bb);
+ while (gsi_stmt (gsi) != gsi_stmt (gsie))
{
tree decl;
label = gsi_stmt (gsi);
gsi_next (&gsi);
}
+ /* Move debug statements if the destination has a single predecessor. */
+ if (can_move_debug_stmts && !gsi_end_p (gsi))
+ {
+ gcc_assert (gsi_stmt (gsi) == gsi_stmt (gsie));
+ gimple_stmt_iterator gsie_to = gsi_after_labels (dest);
+ do
+ {
+ gimple *debug = gsi_stmt (gsi);
+ gcc_assert (is_gimple_debug (debug));
+ gsi_remove (&gsi, false);
+ gsi_insert_before (&gsie_to, debug, GSI_SAME_STMT);
+ }
+ while (!gsi_end_p (gsi));
+ }
+
bitmap_set_bit (cfgcleanup_altered_bbs, dest->index);
/* Update the dominators. */