[Bug optimization/12440] [3.3/3.4 Regression] gcc 3.3.1 on i386 linux 2.4.22 crashes during compilation of quicktime4linux 2.0.0

rakdver at atrey dot karlin dot mff dot cuni dot cz gcc-bugzilla@gcc.gnu.org
Sat Jan 10 23:07:00 GMT 2004


------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz  2004-01-10 23:07 -------
Subject: Re:  [3.3/3.4 Regression] gcc 3.3.1 on i386 linux 2.4.22 crashes during compilation of quicktime4linux 2.0.0

Hello,

> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-10 19:41 -------
> Zdenek could you look at this one too, as this is another loop
> optimization problem that causes memory problems.

the problem is in the old loop optimizer, for which I am not really an
expert.

But it actually is easy to analyse: the loop optimizer consumes memory for
temporary expressions during iv discovery and optimizations (and gc is
only called on the end of the pass), which becomes a problem in case
there is a function with hundreds of nice small loops.  This patch
prevents the memory explosion by adding gc after each loop; I am just
regtesting it.

Zdenek

Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.485
diff -c -3 -p -r1.485 loop.c
*** loop.c	6 Jan 2004 16:51:17 -0000	1.485
--- loop.c	10 Jan 2004 23:04:56 -0000
*************** Software Foundation, 59 Temple Place - S
*** 65,70 ****
--- 65,71 ----
  #include "insn-flags.h"
  #include "optabs.h"
  #include "cfgloop.h"
+ #include "ggc.h"
  
  /* Not really meaningful values, but at least something.  */
  #ifndef SIMULTANEOUS_PREFETCHES
*************** loop_optimize (rtx f, FILE *dumpfile, in
*** 534,540 ****
        struct loop *loop = &loops->array[i];
  
        if (! loop->invalid && loop->end)
! 	scan_loop (loop, flags);
      }
  
    end_alias_analysis ();
--- 535,544 ----
        struct loop *loop = &loops->array[i];
  
        if (! loop->invalid && loop->end)
! 	{
! 	  scan_loop (loop, flags);
! 	  ggc_collect ();
! 	}
      }
  
    end_alias_analysis ();
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1217
diff -c -3 -p -r1.1217 Makefile.in
*** Makefile.in	9 Jan 2004 01:18:35 -0000	1.1217
--- Makefile.in	10 Jan 2004 23:05:01 -0000
*************** value-prof.o : value-prof.c $(CONFIG_H) 
*** 1676,1682 ****
  loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
     insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
     real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \
!    toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H)
  doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h \
     cfgloop.h
--- 1676,1682 ----
  loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
     insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
     real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \
!    toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H) $(GGC_H)
  doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
     $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h \
     cfgloop.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12440



More information about the Gcc-bugs mailing list