- gcc_assert (ef
- && single_pred_p (ef->dest)
- && !phi_nodes (ef->dest)
- && ef->dest != EXIT_BLOCK_PTR);
- gsi_insert_on_edge_immediate (ef, note);
+ /* If there are other predecessors to ef->dest, then
+ there must be PHI nodes for the modified
+ variable, and therefore there will be debug bind
+ stmts after the PHI nodes. The debug bind notes
+ we'd insert would force the creation of a new
+ block (diverging codegen) and be redundant with
+ the post-PHI bind stmts, so don't add them.
+
+ As for the exit edge, there wouldn't be redundant
+ bind stmts, but there wouldn't be a PC to bind
+ them to either, so avoid diverging the CFG. */
+ if (ef && single_pred_p (ef->dest)
+ && ef->dest != EXIT_BLOCK_PTR)
+ {
+ /* If there were PHI nodes in the node, we'd
+ have to make sure the value we're binding
+ doesn't need rewriting. But there shouldn't
+ be PHI nodes in a single-predecessor block,
+ so we just add the note. */
+ gsi_insert_on_edge_immediate (ef, note);
+ }