diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-19 22:07:14 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-19 22:07:14 +0000 |
commit | 36a2709b66ea2d877e935e0bd4cb6391ace472d3 (patch) | |
tree | cc4d61e9e6bc2658197fbb19d9f459bca47f0f94 /gcc/tree-into-ssa.c | |
parent | 95b985e5bc260c2e648f9ffa3cdfe8c29388b7ec (diff) | |
download | gcc-36a2709b66ea2d877e935e0bd4cb6391ace472d3.tar.gz |
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: svn+ssh://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.c | 26 |
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); |