This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: excessive memory consumption
- To: jbuck at synopsys dot com (Joe Buck), egcs at cygnus dot com
- Subject: Re: excessive memory consumption
- From: Jason Merrill <jason at cygnus dot com>
- Date: 03 Oct 1997 12:01:19 -0700
- References: <199709300033.RAA17703.cygnus.egcs@atrus.synopsys.com>
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