This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Minor adjustment to try_forward_edges


After processing each outgoing edge of a basic block, try_forward_edges tests 
whether the block is a forwarder block.  This doesn't make much sense since, 
if there are still more than one outgoing edge, then this cannot be a forwarder 
block.  The attached patch arranges for the test to be done once at the end.

No change in code generation on my set of files, tested on i586-suse-linux, 
applied on the mainline.


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

	* cfgcleanup.c (try_forward_edges): Do not update BB_FORWARDER_BLOCK.
	(try_optimize_cfg): Update BB_FORWARDER_BLOCK if try_forward_edges
	returns true.


-- 
Eric Botcazou
Index: cfgcleanup.c
===================================================================
--- cfgcleanup.c	(revision 174027)
+++ cfgcleanup.c	(working copy)
@@ -599,9 +599,6 @@ try_forward_edges (int mode, basic_block
 			     + REG_BR_PROB_BASE / 2)
 			    / REG_BR_PROB_BASE);
 
-	  if (!FORWARDER_BLOCK_P (b) && forwarder_block_p (b))
-	    b->flags |= BB_FORWARDER_BLOCK;
-
 	  do
 	    {
 	      edge t;
@@ -2693,7 +2690,10 @@ try_optimize_cfg (int mode)
 
 	      /* Simplify branch to branch.  */
 	      if (try_forward_edges (mode, b))
-		changed_here = true;
+		{
+		  update_forwarder_flag (b);
+		  changed_here = true;
+		}
 
 	      /* Look for shared code between blocks.  */
 	      if ((mode & CLEANUP_CROSSJUMP)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]