From f24c0e3a57a4720d43000eacaa57c61fd49d79c4 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 12 Mar 2010 13:04:37 +0000 Subject: PR debug/43329 * tree-inline.c (remap_decls): Put old_var rather than origin_var into *nonlocalized_list vector. * dwarf2out.c (gen_formal_parameter_die): Call decl_ultimate_origin even if origin is non-NULL. (gen_variable_die): Likewise. (process_scope_var): Don't change origin. (gen_decl_die): Likewise. * tree-cfgcleanup.c (remove_forwarder_block): Check single_pred_p before adding new edges instead of after it, fix moving over debug stmts. * gcc.dg/guality/pr43329-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157402 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-cfgcleanup.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/tree-cfgcleanup.c') diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 68929f8de26..eae0c84cef5 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -376,6 +376,7 @@ remove_forwarder_block (basic_block bb) gimple label; edge_iterator ei; gimple_stmt_iterator gsi, gsi_to; + bool can_move_debug_stmts; /* We check for infinite loops already in tree_forwarder_block_p. However it may happen that the infinite loop is created @@ -424,6 +425,8 @@ remove_forwarder_block (basic_block bb) } } + can_move_debug_stmts = single_pred_p (dest); + /* Redirect the edges. */ for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); ) { @@ -480,15 +483,16 @@ remove_forwarder_block (basic_block bb) /* Move debug statements if the destination has just a single predecessor. */ - if (single_pred_p (dest)) + if (can_move_debug_stmts) { gsi_to = gsi_after_labels (dest); for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); ) { - if (!is_gimple_debug (gsi_stmt (gsi))) + gimple debug = gsi_stmt (gsi); + if (!is_gimple_debug (debug)) break; gsi_remove (&gsi, false); - gsi_insert_before (&gsi_to, label, GSI_SAME_STMT); + gsi_insert_before (&gsi_to, debug, GSI_SAME_STMT); } } -- cgit v1.2.1