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]

avoid memory explosin in enable_checking bootstrap


Hi,
I've run into problem with memory explosion on compiling insn_extract
with enable_checking. This is caused by the postdominators problems
discussed earlier making predict.c to predict each NORETURN patch
as many times as there are noreturns.  This is really numbuers with 
enable_checking making gcc to require rought 300MB memory.

Wed Jul 25 00:22:16 CEST 2001  Jan Hubicka <jh@suse.cz>
	* predict.c (estimate_probability): Avoid duplicated predictions.
*** predict.c.old	Wed Jul 25 01:21:46 2001
--- predict.c	Wed Jul 25 01:24:21 2001
*************** estimate_probability (loops_info)
*** 255,260 ****
--- 255,261 ----
  {
    sbitmap *dominators, *post_dominators;
    int i;
+   int found_noreturn = 0;
  
    dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
    post_dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
*************** estimate_probability (loops_info)
*** 309,317 ****
        /* If block has no sucessor, predict all possible paths to
           it as improbable, as the block contains a call to a noreturn
  	 function and thus can be executed only once.  */
!       if (bb->succ == NULL)
  	{
  	  int y;
  	  for (y = 0; y < n_basic_blocks; y++)
  	    if (!TEST_BIT (post_dominators[y], i))
  	      {
--- 310,324 ----
        /* If block has no sucessor, predict all possible paths to
           it as improbable, as the block contains a call to a noreturn
  	 function and thus can be executed only once.  */
!       if (bb->succ == NULL && !found_noreturn)
  	{
  	  int y;
+ 
+ 	  /* ??? Postdominator claims each noreturn block to be postdominated
+ 	     by each, so we need to run only once.  This needs to be changed
+ 	     once postdominace algorithm is updated to say something more sane.
+ 	     */
+ 	  found_noreturn = 1;
  	  for (y = 0; y < n_basic_blocks; y++)
  	    if (!TEST_BIT (post_dominators[y], i))
  	      {


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