This is the mail archive of the gcc@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]

Re: excessive memory consumption


Found it!  In situations of recursive instantiation, there can be a lot of
stuff compiled in the middle of compiling a given function, running up the
label count.  save_for_inline_copying creates new labels for everything
between min_labelno and max_labelno, which can add up to a *lot* of space.

Fri Oct  3 11:56:36 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* toplev.c (rest_of_compilation): Defer all non-nested inlines.

Index: toplev.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.8
diff -c -r1.8 toplev.c
*** toplev.c	1997/09/16 02:07:28	1.8
--- toplev.c	1997/10/03 18:56:30
***************
*** 3022,3027 ****
--- 3022,3032 ----
  		   fflush (rtl_dump_file);
  		 });
  
+       /* If we can, defer compiling inlines until EOF.
+ 	 save_for_inline_copying can be extremely expensive.  */
+       if (inlineable && ! decl_function_context (decl))
+ 	DECL_DEFER_OUTPUT (decl) = 1;
+ 
        /* If function is inline, and we don't yet know whether to
  	 compile it by itself, defer decision till end of compilation.
  	 finish_compilation will call rest_of_compilation again


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