aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-01-22 20:20:51 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-01-22 20:20:51 +0100
commitc47987fa5b5a3b1b72ef9047ebc48c0041479656 (patch)
tree297278494a4ca473cd72eae9c09398fef4f7abf6 /gcc
parent002cda0a8b3a5cff63b60f2f7aaf0684729c7c02 (diff)
downloadgcc-c47987fa5b5a3b1b72ef9047ebc48c0041479656.zip
gcc-c47987fa5b5a3b1b72ef9047ebc48c0041479656.tar.gz
gcc-c47987fa5b5a3b1b72ef9047ebc48c0041479656.tar.bz2
tree-into-ssa.c (maybe_register_def): If stmt ends the bb, insert the debug stmt on the single non-EH edge from the stmt.
* tree-into-ssa.c (maybe_register_def): If stmt ends the bb, insert the debug stmt on the single non-EH edge from the stmt. From-SVN: r156177
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-into-ssa.c24
2 files changed, 27 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 10a3626..5c37530 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-into-ssa.c (maybe_register_def): If stmt ends the bb,
+ insert the debug stmt on the single non-EH edge from the stmt.
+
2010-01-22 Richard Henderson <rth@redhat.com>
PR tree-opt/42833
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 243fe77..c90049e 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -1,5 +1,5 @@
/* Rewrite a program in Normal form into SSA.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
@@ -1858,7 +1858,27 @@ maybe_register_def (def_operand_p def_p, gimple stmt,
if (tracked_var)
{
gimple note = gimple_build_debug_bind (tracked_var, def, stmt);
- gsi_insert_after (&gsi, note, GSI_SAME_STMT);
+ /* If stmt ends the bb, insert the debug stmt on the single
+ non-EH edge from the stmt. */
+ if (gsi_one_before_end_p (gsi) && stmt_ends_bb_p (stmt))
+ {
+ basic_block bb = gsi_bb (gsi);
+ edge_iterator ei;
+ edge e, ef = NULL;
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!(e->flags & EDGE_EH))
+ {
+ 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);
+ }
+ else
+ gsi_insert_after (&gsi, note, GSI_SAME_STMT);
}
}