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]

[PATCH]: Fix regressions due to dominance info change


Fixes f90-intrinsic-bit.f timeout, as well as two other regressions (or so 
i'm told).

Bootstrapped and regtested by Dave Miller on SPARC, and Andreas Jaeger on 
athlon-pc-linux-gnu (Thanks guys!).


2002-06-27  Daniel Berlin  <dberlin@dberlin.org>

	* gcse.c (hoist_code): Rewrite to only get list of dominated
	blocks once per BB. Also fix reversed test (by removing need for 
	the test at all).

Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.206
diff -c -3 -p -w -B -b -r1.206 gcse.c
*** gcse.c	20 Jun 2002 17:50:50 -0000	1.206
--- gcse.c	27 Jun 2002 14:40:31 -0000
*************** static void
*** 5911,5917 ****
  hoist_code ()
  {
    basic_block bb, dominated;
!   unsigned int i;
    struct expr **index_map;
    struct expr *expr;
  
--- 5911,5919 ----
  hoist_code ()
  {
    basic_block bb, dominated;
!   basic_block *domby;
!   unsigned int domby_len;
!   unsigned int i,j;
    struct expr **index_map;
    struct expr *expr;
  
*************** hoist_code ()
*** 5932,5937 ****
--- 5934,5940 ----
        int found = 0;
        int insn_inserted_p;
        
+       domby_len = get_dominated_by (dominators, bb, &domby);
        /* Examine each expression that is very busy at the exit of this
  	 block.  These are the potentially hoistable expressions.  */
        for (i = 0; i < hoist_vbeout[bb->index]->n_bits; i++)
*************** hoist_code ()
*** 5943,5955 ****
  	      /* We've found a potentially hoistable expression, now
  		 we look at every block BB dominates to see if it
  		 computes the expression.  */
! 	      FOR_EACH_BB (dominated)
  		{
  		  /* Ignore self dominance.  */
! 		  if (bb == dominated
! 		      || dominated_by_p (dominators, dominated, bb))
  		    continue;
- 
  		  /* We've found a dominated block, now see if it computes
  		     the busy expression and whether or not moving that
  		     expression to the "beginning" of that block is safe.  */
--- 5947,5958 ----
  	      /* We've found a potentially hoistable expression, now
  		 we look at every block BB dominates to see if it
  		 computes the expression.  */
! 	      for (j = 0; j < domby_len; j++)
  		{
+ 		  dominated = domby[j];
  		  /* Ignore self dominance.  */
! 		  if (bb == dominated)
  		    continue;
  		  /* We've found a dominated block, now see if it computes
  		     the busy expression and whether or not moving that
  		     expression to the "beginning" of that block is safe.  */
*************** hoist_code ()
*** 5982,5991 ****
  		}
  	    }
  	}
- 
        /* If we found nothing to hoist, then quit now.  */
        if (! found)
  	continue;
  
        /* Loop over all the hoistable expressions.  */
        for (i = 0; i < hoist_exprs[bb->index]->n_bits; i++)
--- 5985,5996 ----
  		}
  	    }
  	}
        /* If we found nothing to hoist, then quit now.  */
        if (! found)
+         {
+   	  free (domby);
  	  continue;
+ 	}
  
        /* Loop over all the hoistable expressions.  */
        for (i = 0; i < hoist_exprs[bb->index]->n_bits; i++)
*************** hoist_code ()
*** 6000,6010 ****
  	      /* We've found a potentially hoistable expression, now
  		 we look at every block BB dominates to see if it
  		 computes the expression.  */
! 	      FOR_EACH_BB (dominated)
  		{
  		  /* Ignore self dominance.  */
! 		  if (bb == dominated
! 		      || ! dominated_by_p (dominators, dominated, bb))
  		    continue;
  
  		  /* We've found a dominated block, now see if it computes
--- 6005,6015 ----
  	      /* We've found a potentially hoistable expression, now
  		 we look at every block BB dominates to see if it
  		 computes the expression.  */
! 	      for (j = 0; j < domby_len; j++)
  		{
+ 		  dominated = domby[j];
  		  /* Ignore self dominance.  */
! 		  if (bb == dominated)
  		    continue;
  
  		  /* We've found a dominated block, now see if it computes
*************** hoist_code ()
*** 6058,6063 ****
--- 6063,6069 ----
  		}
  	    }
  	}
+       free (domby);
      }
  
    free (index_map);


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