Patch to fix flow_depth_first_order_compute

John Wehle john@feith.com
Mon Dec 10 23:02:00 GMT 2001


flow_depth_first_order_compute has the comment:

  Compute the depth first search order and store in the array
  DFS_ORDER if non-zero

However passing zero for dfs_order currently causes
an abort since dfsnum is never incremented.

This patch passes make bootstrap and make check on
Dec Alpha 4.0f, Solaris 7 SPARC, and Solaris 7 x86.

ChangeLog:

Mon Dec 10 12:54:46 EST 2001  John Wehle  (john@feith.com)

	* cfganal.c (flow_depth_first_order_compute): Always
	increment dfsnum.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/cfganal.c.ORIGINAL	Thu Nov 29 12:26:11 2001
--- gcc/cfganal.c	Mon Dec 10 12:51:54 2001
*************** flow_depth_first_order_compute (dfs_orde
*** 874,880 ****
  	  SET_BIT (visited, dest->index);
  
  	  if (dfs_order)
! 	    dfs_order[dfsnum++] = dest->index;
  
  	  if (dest->succ)
  	    {
--- 874,882 ----
  	  SET_BIT (visited, dest->index);
  
  	  if (dfs_order)
! 	    dfs_order[dfsnum] = dest->index;
! 
! 	  dfsnum++;
  
  	  if (dest->succ)
  	    {
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc-patches mailing list