gcc_assert (bb != ENTRY_BLOCK_PTR);
#endif
+ /* There should not be an edge coming from entry, or an EH edge. */
+ {
+ edge_iterator ei;
+ edge e;
+
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ if (e->src == ENTRY_BLOCK_PTR || (e->flags & EDGE_EH))
+ return false;
+ }
+
/* Now walk through the statements backward. We can ignore labels,
anything else means this is not a forwarder block. */
for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
return false;
break;
+ /* ??? For now, hope there's a corresponding debug
+ assignment at the destination. */
+ case GIMPLE_DEBUG:
+ break;
+
default:
return false;
}
}
- if (find_edge (ENTRY_BLOCK_PTR, bb))
- return false;
-
if (current_loops)
{
basic_block dest;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
label = gsi_stmt (gsi);
- gcc_assert (gimple_code (label) == GIMPLE_LABEL);
+ gcc_assert (gimple_code (label) == GIMPLE_LABEL
+ || is_gimple_debug (label));
gsi_remove (&gsi, false);
- gsi_insert_before (&gsi_to, label, GSI_CONTINUE_LINKING);
+ gsi_insert_before (&gsi_to, label, GSI_SAME_STMT);
}
}