On Fri, 13 Jan 2012, Jason Merrill wrote: > While looking at the -fmem-stats results for this testcase, I noticed about > 500MB of overhead coming from the VEC_safe_push in cp_lexer_new_main. This is > happening because when we allocate space for a vector, the allocator pads it > out some, and that space ends up lost. The first patch changes the vector code > to ask the gc allocator how much space it's really going to get, and adjust > the number of slots to fill that space. This reduces the VM footprint of the > compiler for the testcase from 1704 MB to 1162 MB, an almost 32% reduction. > > The second patch is derived from Jan's patch of > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12245#c42 > > and further reduces the VM footprint to 967 MB, not quite back to the 2.95 > level of 717 MB, but pretty close. > > Tested x86_64-pc-linux-gnu. Are one or both of these OK for trunk?
I suppose the 2nd could be generally folding for tcc_constant, not only integer constants (suppose an array of REAL_CSTs). Both are IMHO ok as they address regressions. Thanks, Richard.