diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-11 12:53:43 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-11 12:53:43 +0000 |
commit | 8ebd8f29e96a1b18c27d84866b0b28ac0b344dea (patch) | |
tree | e56042c0e2d22f04c029f1f376845c9c63d30b83 /gcc/tree-ssa.c | |
parent | 564cba5f5310fd500b946ba26f9e24dae478d3c8 (diff) | |
download | gcc-8ebd8f29e96a1b18c27d84866b0b28ac0b344dea.tar.gz |
PR debug/48159
* tree-ssa.c (reset_debug_uses): New function.
* tree-flow.h (reset_debug_uses): New prototype.
* tree-data-ref.c (stmts_from_loop): Ignore debug stmts.
* tree-loop-distribution.c (generate_loops_for_partition): Call
reset_debug_uses on the stmts that will be removed. Keep around
all debug stmts, don't count them as bits in partition bitmap.
(generate_builtin): Don't count debug stmts or labels as bits in
partition bitmap.
* gcc.dg/pr48159-1.c: New test.
* gcc.dg/pr48159-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173656 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index fe8a74c59cf..f596fcd870c 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -507,6 +507,37 @@ insert_debug_temps_for_defs (gimple_stmt_iterator *gsi) } } +/* Reset all debug stmts that use SSA_NAME(s) defined in STMT. */ + +void +reset_debug_uses (gimple stmt) +{ + ssa_op_iter op_iter; + def_operand_p def_p; + imm_use_iterator imm_iter; + gimple use_stmt; + + if (!MAY_HAVE_DEBUG_STMTS) + return; + + FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF) + { + tree var = DEF_FROM_PTR (def_p); + + if (TREE_CODE (var) != SSA_NAME) + continue; + + FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, var) + { + if (!gimple_debug_bind_p (use_stmt)) + continue; + + gimple_debug_bind_reset_value (use_stmt); + update_stmt (use_stmt); + } + } +} + /* Delete SSA DEFs for SSA versions in the TOREMOVE bitmap, removing dominated stmts before their dominators, so that release_ssa_defs stands a chance of propagating DEFs into debug bind stmts. */ |