static void
rtl_merge_blocks (basic_block a, basic_block b)
{
+ /* If B is a forwarder block whose outgoing edge has no location, we'll
+ propagate the locus of the edge between A and B onto it. */
+ const bool forward_edge_locus
+ = (b->flags & BB_FORWARDER_BLOCK) != 0
+ && LOCATION_LOCUS (EDGE_SUCC (b, 0)->goto_locus) == UNKNOWN_LOCATION;
rtx_insn *b_head = BB_HEAD (b), *b_end = BB_END (b), *a_end = BB_END (a);
rtx_insn *del_first = NULL, *del_last = NULL;
rtx_insn *b_debug_start = b_end, *b_debug_end = b_end;
- bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0;
int b_empty = 0;
if (dump_file)
BB_HEAD (b) = b_empty ? NULL : b_head;
delete_insn_chain (del_first, del_last, true);
- /* When not optimizing and the edge is the only place in RTL which holds
- some unique locus, emit a nop with that locus in between. */
- if (!optimize)
+ /* If not optimizing, preserve the locus of the single edge between
+ blocks A and B if necessary by emitting a nop. */
+ if (!optimize
+ && !forward_edge_locus
+ && !DECL_IGNORED_P (current_function_decl))
{
emit_nop_for_unique_locus_between (a, b);
a_end = BB_END (a);
df_bb_delete (b->index);
- /* If B was a forwarder block, propagate the locus on the edge. */
- if (forwarder_p
- && LOCATION_LOCUS (EDGE_SUCC (b, 0)->goto_locus) == UNKNOWN_LOCATION)
+ if (forward_edge_locus)
EDGE_SUCC (b, 0)->goto_locus = EDGE_SUCC (a, 0)->goto_locus;
if (dump_file)
force_nonfallthru (e);
}
- /* Ensure goto_locus from edges has some instructions with that locus
- in RTL. */
- if (!optimize)
+ /* Ensure goto_locus from edges has some instructions with that locus in RTL
+ when not optimizing. */
+ if (!optimize && !DECL_IGNORED_P (current_function_decl))
FOR_EACH_BB_FN (bb, cfun)
{
edge e;
static void
cfg_layout_merge_blocks (basic_block a, basic_block b)
{
- bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0;
+ /* If B is a forwarder block whose outgoing edge has no location, we'll
+ propagate the locus of the edge between A and B onto it. */
+ const bool forward_edge_locus
+ = (b->flags & BB_FORWARDER_BLOCK) != 0
+ && LOCATION_LOCUS (EDGE_SUCC (b, 0)->goto_locus) == UNKNOWN_LOCATION;
rtx_insn *insn;
gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b));
try_redirect_by_replacing_jump (EDGE_SUCC (a, 0), b, true);
gcc_assert (!JUMP_P (BB_END (a)));
- /* When not optimizing and the edge is the only place in RTL which holds
- some unique locus, emit a nop with that locus in between. */
- if (!optimize)
+ /* If not optimizing, preserve the locus of the single edge between
+ blocks A and B if necessary by emitting a nop. */
+ if (!optimize
+ && !forward_edge_locus
+ && !DECL_IGNORED_P (current_function_decl))
emit_nop_for_unique_locus_between (a, b);
/* Move things from b->footer after a->footer. */
df_bb_delete (b->index);
- /* If B was a forwarder block, propagate the locus on the edge. */
- if (forwarder_p
- && LOCATION_LOCUS (EDGE_SUCC (b, 0)->goto_locus) == UNKNOWN_LOCATION)
+ if (forward_edge_locus)
EDGE_SUCC (b, 0)->goto_locus = EDGE_SUCC (a, 0)->goto_locus;
if (dump_file)