Minor haifa bugfix

Jeffrey A Law law@cygnus.com
Tue Aug 31 22:41:00 GMT 1999


haifa was not finding multiple-block scheduling regions properly because it
incorrectly thought some blocks with no successors were not reachable, even
though they were found during the DFS search through the flow graph.

This band-aid patch fixes the problem for now.  I expect much of this code
will be completely revamped in the not too distant future to use rth's new
cfg code.

	* haifa-sched.c (find_rgns): Mark a block found during the DFS search
	as reachable.

Index: haifa-sched.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/haifa-sched.c,v
retrieving revision 1.97
diff -c -3 -p -r1.97 haifa-sched.c
*** haifa-sched.c	1999/08/25 04:58:36	1.97
--- haifa-sched.c	1999/08/25 05:20:05
*************** find_rgns (s_preds, s_succs, num_preds, 
*** 1595,1600 ****
--- 1595,1615 ----
        stack[++sp] = current_edge;
        SET_BIT (passed, current_edge);
        current_edge = OUT_EDGES (child);
+ 
+       /* This is temporary until haifa is converted to use rth's new
+ 	 cfg routines which have true entry/exit blocks and the
+ 	 appropriate edges from/to those blocks.
+ 
+ 	 Generally we update dfs_nr for a node when we process its
+ 	 out edge.  However, if the node has no out edge then we will
+ 	 not set dfs_nr for that node.  This can confuse the scheduler
+ 	 into thinking that we have unreachable blocks, which in turn
+ 	 disables cross block scheduling. 
+ 
+ 	 So, if we have a node with no out edges, go ahead and mark it
+ 	 as reachable now.  */
+       if (current_edge == 0)
+ 	dfs_nr[child] = ++count;
      }
  
    /* Another check for unreachable blocks.  The earlier test in






More information about the Gcc-patches mailing list