Patchwork Minor tweaks

login
register
mail settings
Submitter Eric Botcazou
Date May 13, 2011, 7:56 p.m.
Message ID <201105132156.40085.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/95507/
State New
Headers show

Comments

Eric Botcazou - May 13, 2011, 7:56 p.m.
The attached patch contains 3 minor tweaks:

  1. Jeff moved a dump message in cfg_layout_redirect_edge_and_branch up to 
before the call to redirect_edge_succ_nodup.  So the "redirected" is not fully 
true anymore and can be confusing since the call to redirect_edge_succ_nodup 
can dump messages too.  Changed to "redirecting" like a few lines above.

  2. regcprop.c tests MAY_HAVE_DEBUG_STMTS.  Now this is a RTL pass so the most 
correct incantation is MAY_HAVE_DEBUG_INSNS.

  3. remove_forwarder_block attempts to move debug statements.  There is no 
need to do it when !MAY_HAVE_DEBUG_STMTS.

Tested on i586-suse-linux, applied on the mainline as obvious.


2011-05-13  Eric Botcazou  <ebotcazou@adacore.com>

	* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Adjust dump message.
	* regcprop.c (copyprop_hardreg_forward): Test MAY_HAVE_DEBUG_INSNS in
	lieu of MAY_HAVE_DEBUG_STMTS.
	* tree-cfgcleanup.c (remove_forwarder_block): Do not attempt to move
	debug statements if !MAY_HAVE_DEBUG_STMTS.

Patch

Index: cfgrtl.c
===================================================================
--- cfgrtl.c	(revision 173693)
+++ cfgrtl.c	(working copy)
@@ -2608,7 +2608,7 @@  cfg_layout_redirect_edge_and_branch (edg
 	    delete_insn (BB_END (src));
 	}
       if (dump_file)
-	fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
+	fprintf (dump_file, "Redirecting fallthru edge %i->%i to %i\n",
 		 e->src->index, e->dest->index, dest->index);
       ret = redirect_edge_succ_nodup (e, dest);
     }
Index: regcprop.c
===================================================================
--- regcprop.c	(revision 173693)
+++ regcprop.c	(working copy)
@@ -990,7 +990,7 @@  copyprop_hardreg_forward (void)
   visited = sbitmap_alloc (last_basic_block);
   sbitmap_zero (visited);
 
-  if (MAY_HAVE_DEBUG_STMTS)
+  if (MAY_HAVE_DEBUG_INSNS)
     debug_insn_changes_pool
       = create_alloc_pool ("debug insn changes pool",
 			   sizeof (struct queued_debug_insn_change), 256);
@@ -1029,7 +1029,7 @@  copyprop_hardreg_forward (void)
       copyprop_hardreg_forward_1 (bb, all_vd + bb->index);
     }
 
-  if (MAY_HAVE_DEBUG_STMTS)
+  if (MAY_HAVE_DEBUG_INSNS)
     {
       FOR_EACH_BB (bb)
 	if (TEST_BIT (visited, bb->index)
Index: tree-cfgcleanup.c
===================================================================
--- tree-cfgcleanup.c	(revision 173693)
+++ tree-cfgcleanup.c	(working copy)
@@ -420,7 +420,7 @@  remove_forwarder_block (basic_block bb)
 	}
     }
 
-  can_move_debug_stmts = single_pred_p (dest);
+  can_move_debug_stmts = MAY_HAVE_DEBUG_STMTS && single_pred_p (dest);
 
   /* Redirect the edges.  */
   for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
@@ -476,8 +476,7 @@  remove_forwarder_block (basic_block bb)
 	gsi_next (&gsi);
     }
 
-  /* Move debug statements if the destination has just a single
-     predecessor.  */
+  /* Move debug statements if the destination has a single predecessor.  */
   if (can_move_debug_stmts)
     {
       gsi_to = gsi_after_labels (dest);