aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-into-ssa.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2011-01-19 22:07:14 +0000
committerAlexandre Oliva <aoliva@redhat.com>2011-01-19 22:07:14 +0000
commitd4385d7522f4733547402093602d05de0b4e32b2 (patch)
treecc4d61e9e6bc2658197fbb19d9f459bca47f0f94 /gcc/tree-into-ssa.c
parent1ea29db7c64cc63550b0448832df0d770796290c (diff)
gcc/ChangeLog:
PR debug/46240 * tree-into-ssa.c (maybe_register_def): Do not attempt to add debug bind stmt on merge edges. gcc/testsuite/ChangeLog: PR debug/46240 * g++.dg/debug/pr46240.cc: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@169035 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-into-ssa.c')
-rw-r--r--gcc/tree-into-ssa.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 8d31fe7607e..c425586a156 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -1869,11 +1869,27 @@ maybe_register_def (def_operand_p def_p, gimple stmt,
gcc_assert (!ef);
ef = e;
}
- 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);
+ }
}
else
gsi_insert_after (&gsi, note, GSI_SAME_STMT);