This is the mail archive of the gcc-regression@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]
Other format: [Raw text]

A recent patch increased GCC's memory consumption!


Hi,

I am a friendly script caring about memory consumption in GCC.  Please
contact jh@suse.cz if something is going wrong.

Comparing memory consumption on compilation of combine.i, insn-attrtab.i,
and generate-3.4.ii I got:


comparing empty function compilation at -O0 level:
    Overall memory needed: 8153k
    Peak memory use before GGC: 1143k
    Peak memory use after GGC: 1047k
    Maximum of released memory in single GGC run: 132k
    Garbage: 245k -> 245k
    Leak: 1000k
    Overhead: 91k -> 91k
    GGC runs: 4
Testing has produced no results
Testing has produced no results

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8237k
    Peak memory use before GGC: 1171k
    Peak memory use after GGC: 1075k
    Maximum of released memory in single GGC run: 134k
    Garbage: 247k -> 248k
    Leak: 1033k
    Overhead: 95k -> 95k
    GGC runs: 4
Testing has produced no results
Testing has produced no results

comparing empty function compilation at -O1 level:
    Overall memory needed: 8229k
    Peak memory use before GGC: 1143k
    Peak memory use after GGC: 1039k
    Maximum of released memory in single GGC run: 130k
    Garbage: 248k -> 248k
    Leak: 1000k
    Overhead: 91k -> 91k
    GGC runs: 3
    Pre-IPA-Garbage: 235k -> 235k
    Pre-IPA-Leak: 1002k -> 1002k
    Pre-IPA-Overhead: 89k -> 89k
    Post-IPA-Garbage: 235k -> 235k
    Post-IPA-Leak: 1002k -> 1002k
    Post-IPA-Overhead: 89k -> 89k

comparing empty function compilation at -O2 level:
    Overall memory needed: 8257k
    Peak memory use before GGC: 1143k
    Peak memory use after GGC: 1040k
    Maximum of released memory in single GGC run: 130k -> 129k
    Garbage: 252k -> 252k
    Leak: 1001k
    Overhead: 92k -> 92k
    GGC runs: 3
    Pre-IPA-Garbage: 235k -> 235k
    Pre-IPA-Leak: 1003k -> 1003k
    Pre-IPA-Overhead: 89k -> 89k
    Post-IPA-Garbage: 235k -> 235k
    Post-IPA-Leak: 1003k -> 1003k
    Post-IPA-Overhead: 89k -> 89k

comparing empty function compilation at -O3 level:
    Overall memory needed: 8245k
    Peak memory use before GGC: 1143k
    Peak memory use after GGC: 1040k
    Maximum of released memory in single GGC run: 130k -> 129k
    Garbage: 252k -> 252k
    Leak: 1001k
    Overhead: 92k -> 92k
    GGC runs: 3
    Pre-IPA-Garbage: 235k -> 235k
    Pre-IPA-Leak: 1003k -> 1003k
    Pre-IPA-Overhead: 89k -> 89k
    Post-IPA-Garbage: 235k -> 235k
    Post-IPA-Leak: 1003k -> 1003k
    Post-IPA-Overhead: 89k -> 89k

comparing combine.c compilation at -O0 level:
    Overall memory needed: 22673k -> 22685k
    Peak memory use before GGC: 7992k -> 7994k
    Peak memory use after GGC: 7369k -> 7370k
    Maximum of released memory in single GGC run: 1545k -> 1546k
    Garbage: 38103k -> 38099k
    Leak: 5498k -> 5500k
    Overhead: 4686k -> 4688k
    GGC runs: 367
Testing has produced no results
Testing has produced no results

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 24777k -> 24781k
    Peak memory use before GGC: 9989k -> 9993k
    Peak memory use after GGC: 9369k -> 9371k
    Maximum of released memory in single GGC run: 1832k
    Garbage: 38429k -> 38443k
    Leak: 8807k -> 8809k
    Overhead: 5507k -> 5509k
    GGC runs: 336
Testing has produced no results
Testing has produced no results

comparing combine.c compilation at -O1 level:
    Overall memory needed: 32701k -> 32697k
    Peak memory use before GGC: 16319k -> 16320k
    Peak memory use after GGC: 16154k -> 16155k
    Maximum of released memory in single GGC run: 1415k -> 1416k
    Garbage: 52355k -> 52362k
    Leak: 5154k
    Overhead: 5838k -> 5840k
    GGC runs: 438
    Pre-IPA-Garbage: 13940k -> 13943k
    Pre-IPA-Leak: 17168k -> 17169k
    Pre-IPA-Overhead: 2146k -> 2147k
    Post-IPA-Garbage: 13940k -> 13943k
    Post-IPA-Leak: 17168k -> 17169k
    Post-IPA-Overhead: 2146k -> 2147k

comparing combine.c compilation at -O2 level:
    Overall memory needed: 34441k -> 34445k
    Peak memory use before GGC: 16414k -> 16415k
    Peak memory use after GGC: 16250k -> 16251k
    Maximum of released memory in single GGC run: 1344k
    Garbage: 72468k -> 72482k
    Leak: 5195k
    Overhead: 8181k -> 8183k
    GGC runs: 510
    Pre-IPA-Garbage: 14089k -> 14091k
    Pre-IPA-Leak: 17234k -> 17236k
    Pre-IPA-Overhead: 2159k -> 2160k
    Post-IPA-Garbage: 14089k -> 14091k
    Post-IPA-Leak: 17234k -> 17236k
    Post-IPA-Overhead: 2159k -> 2160k

comparing combine.c compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 5215k to 5223k, overall 0.14%
    Overall memory needed: 38517k -> 38773k
    Peak memory use before GGC: 16488k -> 16489k
    Peak memory use after GGC: 16264k -> 16265k
    Maximum of released memory in single GGC run: 2494k
    Garbage: 92265k -> 92255k
    Leak: 5215k -> 5223k
    Overhead: 10706k -> 10707k
    GGC runs: 544
    Pre-IPA-Garbage: 14089k -> 14092k
    Pre-IPA-Leak: 17246k -> 17247k
    Pre-IPA-Overhead: 2160k -> 2161k
    Post-IPA-Garbage: 14089k -> 14092k
    Post-IPA-Leak: 17246k -> 17247k
    Post-IPA-Overhead: 2160k -> 2161k

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 137545k
    Peak memory use before GGC: 57416k -> 57417k
    Peak memory use after GGC: 31842k -> 31843k
    Maximum of released memory in single GGC run: 33223k
    Garbage: 130448k -> 130446k
    Leak: 6966k -> 6967k
    Overhead: 14394k -> 14395k
    GGC runs: 291
Testing has produced no results
Testing has produced no results

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 138833k
    Peak memory use before GGC: 58676k -> 58677k
    Peak memory use after GGC: 33101k -> 33102k
    Maximum of released memory in single GGC run: 33224k
    Garbage: 130948k -> 130946k
    Leak: 8625k -> 8626k
    Overhead: 14853k -> 14853k
    GGC runs: 285
Testing has produced no results
Testing has produced no results

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 141357k -> 141337k
    Peak memory use before GGC: 54729k
    Peak memory use after GGC: 48995k
    Maximum of released memory in single GGC run: 24638k
    Garbage: 208899k -> 208901k
    Leak: 6453k
    Overhead: 24717k -> 24718k
    GGC runs: 315
    Pre-IPA-Garbage: 50402k -> 50402k
    Pre-IPA-Leak: 49444k -> 49445k
    Pre-IPA-Overhead: 7464k -> 7465k
    Post-IPA-Garbage: 50402k -> 50402k
    Post-IPA-Leak: 49444k -> 49445k
    Post-IPA-Overhead: 7464k -> 7465k

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 181845k -> 181673k
    Peak memory use before GGC: 55413k
    Peak memory use after GGC: 50023k
    Maximum of released memory in single GGC run: 23520k
    Garbage: 251772k -> 251774k
    Leak: 6481k
    Overhead: 30748k -> 30749k
    GGC runs: 349
    Pre-IPA-Garbage: 50470k -> 50471k
    Pre-IPA-Leak: 49449k -> 49450k
    Pre-IPA-Overhead: 7471k -> 7471k
    Post-IPA-Garbage: 50470k -> 50471k
    Post-IPA-Leak: 49449k -> 49450k
    Post-IPA-Overhead: 7471k -> 7471k

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 190633k -> 190617k
    Peak memory use before GGC: 68247k -> 68248k
    Peak memory use after GGC: 63471k
    Maximum of released memory in single GGC run: 25532k
    Garbage: 278992k -> 278990k
    Leak: 6489k
    Overhead: 32655k -> 32656k
    GGC runs: 352
    Pre-IPA-Garbage: 50470k -> 50471k
    Pre-IPA-Leak: 49449k -> 49450k
    Pre-IPA-Overhead: 7471k -> 7471k
    Post-IPA-Garbage: 50470k -> 50471k
    Post-IPA-Leak: 49449k -> 49450k
    Post-IPA-Overhead: 7471k -> 7471k

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 79767k to 79911k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collecting increased from 78978k to 79120k, overall 0.18%
  Amount of memory still referenced at the end of compilation increased from 47629k to 47678k, overall 0.10%
    Overall memory needed: 142978k -> 143048k
    Peak memory use before GGC: 79767k -> 79911k
    Peak memory use after GGC: 78978k -> 79120k
    Maximum of released memory in single GGC run: 14774k -> 14843k
    Garbage: 196472k -> 196636k
    Leak: 47629k -> 47678k
    Overhead: 24120k -> 24191k
    GGC runs: 416 -> 417
  Amount of memory referenced pre-ipa increased from 68560k to 68671k, overall 0.16%
    Pre-IPA-Garbage: 107200k -> 107302k
    Pre-IPA-Leak: 68560k -> 68671k
    Pre-IPA-Overhead: 11993k -> 12064k
  Amount of memory referenced post-ipa increased from 68560k to 68671k, overall 0.16%
    Post-IPA-Garbage: 107200k -> 107302k
    Post-IPA-Leak: 68560k -> 68671k
    Post-IPA-Overhead: 11993k -> 12064k

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Peak amount of GGC memory allocated before garbage collecting increased from 94059k to 94232k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collecting increased from 93126k to 93299k, overall 0.19%
    Overall memory needed: 165406k -> 165580k
    Peak memory use before GGC: 94059k -> 94232k
    Peak memory use after GGC: 93126k -> 93299k
    Maximum of released memory in single GGC run: 15584k -> 15682k
    Garbage: 202101k -> 202275k
    Leak: 74204k -> 74254k
    Overhead: 30808k -> 30879k
    GGC runs: 384
  Amount of memory referenced pre-ipa increased from 85127k to 85238k, overall 0.13%
    Pre-IPA-Garbage: 107844k -> 107945k
    Pre-IPA-Leak: 85127k -> 85238k
    Pre-IPA-Overhead: 15532k -> 15603k
  Amount of memory referenced post-ipa increased from 85127k to 85238k, overall 0.13%
    Post-IPA-Garbage: 107844k -> 107945k
    Post-IPA-Leak: 85127k -> 85238k
    Post-IPA-Overhead: 15532k -> 15603k

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 78909k to 79038k, overall 0.16%
  Peak amount of GGC memory still allocated after garbage collecting increased from 78036k to 78196k, overall 0.21%
  Amount of memory still referenced at the end of compilation increased from 44403k to 44453k, overall 0.11%
    Overall memory needed: 117413k -> 117511k
    Peak memory use before GGC: 78909k -> 79038k
    Peak memory use after GGC: 78036k -> 78196k
    Maximum of released memory in single GGC run: 14405k -> 14459k
    Garbage: 287492k -> 287665k
    Leak: 44403k -> 44453k
    Overhead: 28578k -> 28650k
    GGC runs: 516 -> 517
  Amount of produced pre-ipa-GGC garbage increased from 149177k to 149328k, overall 0.10%
    Pre-IPA-Garbage: 149177k -> 149328k
    Pre-IPA-Leak: 82228k -> 82290k
    Pre-IPA-Overhead: 16591k -> 16662k
  Amount of produced post-ipa-GGC garbage increased from 149177k to 149328k, overall 0.10%
    Post-IPA-Garbage: 149177k -> 149328k
    Post-IPA-Leak: 82228k -> 82290k
    Post-IPA-Overhead: 16591k -> 16662k

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 79197k to 79339k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collecting increased from 78408k to 78550k, overall 0.18%
  Amount of memory still referenced at the end of compilation increased from 44546k to 44596k, overall 0.11%
    Overall memory needed: 119641k -> 119619k
    Peak memory use before GGC: 79197k -> 79339k
    Peak memory use after GGC: 78408k -> 78550k
    Maximum of released memory in single GGC run: 14359k -> 14427k
    Garbage: 353394k -> 353551k
    Leak: 44546k -> 44596k
    Overhead: 35493k -> 35567k
    GGC runs: 595 -> 596
  Amount of produced pre-ipa-GGC garbage increased from 150775k to 150928k, overall 0.10%
    Pre-IPA-Garbage: 150775k -> 150928k
    Pre-IPA-Leak: 82102k -> 82163k
    Pre-IPA-Overhead: 16724k -> 16795k
  Amount of produced post-ipa-GGC garbage increased from 150775k to 150928k, overall 0.10%
    Post-IPA-Garbage: 150775k -> 150928k
    Post-IPA-Leak: 82102k -> 82163k
    Post-IPA-Overhead: 16724k -> 16795k

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 80190k to 80331k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collecting increased from 79381k to 79526k, overall 0.18%
  Amount of memory still referenced at the end of compilation increased from 44927k to 44976k, overall 0.11%
    Overall memory needed: 122057k -> 122095k
    Peak memory use before GGC: 80190k -> 80331k
    Peak memory use after GGC: 79381k -> 79526k
    Maximum of released memory in single GGC run: 14717k -> 14783k
    Garbage: 380851k -> 380996k
    Leak: 44927k -> 44976k
    Overhead: 37794k -> 37864k
    GGC runs: 616 -> 617
  Amount of produced pre-ipa-GGC garbage increased from 153397k to 153552k, overall 0.10%
    Pre-IPA-Garbage: 153397k -> 153552k
    Pre-IPA-Leak: 82368k -> 82429k
    Pre-IPA-Overhead: 16966k -> 17038k
  Amount of produced post-ipa-GGC garbage increased from 153397k to 153552k, overall 0.10%
    Post-IPA-Garbage: 153397k -> 153552k
    Post-IPA-Leak: 82368k -> 82429k
    Post-IPA-Overhead: 16966k -> 17038k

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 380754k -> 380756k
    Peak memory use before GGC: 101137k
    Peak memory use after GGC: 56790k
    Maximum of released memory in single GGC run: 50583k -> 50582k
    Garbage: 178628k -> 178629k
    Leak: 6218k -> 6218k
    Overhead: 30603k -> 30603k
    GGC runs: 105
Testing has produced no results
Testing has produced no results

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 381626k -> 381628k
    Peak memory use before GGC: 101838k
    Peak memory use after GGC: 57491k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 178695k -> 178695k
    Leak: 8265k -> 8265k
    Overhead: 31188k -> 31189k
    GGC runs: 110
Testing has produced no results
Testing has produced no results

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 390485k -> 391373k
    Peak memory use before GGC: 75641k
    Peak memory use after GGC: 67585k
    Maximum of released memory in single GGC run: 35733k
    Garbage: 244850k -> 244851k
    Leak: 7883k
    Overhead: 31115k -> 31115k
    GGC runs: 106
    Pre-IPA-Garbage: 49701k -> 49701k
    Pre-IPA-Leak: 63704k -> 63704k
    Pre-IPA-Overhead: 6704k -> 6704k
    Post-IPA-Garbage: 49701k -> 49701k
    Post-IPA-Leak: 63704k -> 63704k
    Post-IPA-Overhead: 6704k -> 6704k

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 303185k -> 303961k
    Peak memory use before GGC: 75641k
    Peak memory use after GGC: 67585k
    Maximum of released memory in single GGC run: 32543k
    Garbage: 258971k -> 258971k
    Leak: 8046k
    Overhead: 34158k -> 34158k
    GGC runs: 117
    Pre-IPA-Garbage: 107696k -> 107696k
    Pre-IPA-Leak: 75527k -> 75527k
    Pre-IPA-Overhead: 10955k -> 10955k
    Post-IPA-Garbage: 107696k -> 107696k
    Post-IPA-Leak: 75527k -> 75527k
    Post-IPA-Overhead: 10955k -> 10955k

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1070449k -> 1070413k
    Peak memory use before GGC: 142467k
    Peak memory use after GGC: 129122k
    Maximum of released memory in single GGC run: 59644k
    Garbage: 356487k -> 356488k
    Leak: 11026k
    Overhead: 38240k -> 38240k
    GGC runs: 102
    Pre-IPA-Garbage: 107696k -> 107696k
    Pre-IPA-Leak: 75527k -> 75527k
    Pre-IPA-Overhead: 10955k -> 10955k
    Post-IPA-Garbage: 107696k -> 107696k
    Post-IPA-Leak: 75527k -> 75527k
    Post-IPA-Overhead: 10955k -> 10955k

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2008-06-02 23:49:32.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2008-06-03 08:30:21.000000000 +0000
@@ -1,3 +1,73 @@
+2008-06-03  Kai Tietz  <kai.tietz@onevision.com>
+
+	* doc/tm.texi (OVERRIDE_ABI_FORMAT): New.
+	* doc/extend.texi (ms_abi,sysv_abi): New attribute description.
+	* function.c (allocate_struct_function): Use of
+	OVERRIDE_ABI_FORMAT.
+	* config/i386/cygming.h (TARGET_64BIT_MS_ABI): Make use
+	of cfun and DEFAULT_ABI to deceide abi mode.
+	(DEFAULT_ABI): New.
+	(REG_PARM_STACK_SPACE): Removed.
+	(OUTGOING_REG_PARM_STACK_SPACE): Removed.
+	(STACK_BOUNDARY): Use default target to deceide stack boundary.
+	* config/i386/i386-protos.h (ix86_cfun_abi): New.
+	(ix86_function_abi): Likewise.
+	(ix86_function_type_abi): Likewise.
+	(ix86_call_abi_override): Likewise.
+	* confid/i386/i386.md (SSE_REGPARM_MAX): Replaced by abi
+	specific define X86_64_SSE_REGPARM_MAX/X64_SSE_REGPARM_MAX.
+	* config/i386/i386.c (override_options): Replace TARGET_64BIT_MS_ABI.
+	(X86_64_VARARGS_SIZE): Replace REGPARM_MAX and SSE_REGPARM_MAX by abi
+	specific defines.
+	(X86_64_REGPARM_MAX): New.
+	(X86_64_SSE_REGPARM_MAX): New.
+	(X64_REGPARM_MAX): New.
+	(X64_SSE_REGPARM_MAX): New.
+	(X86_32_REGPARM_MAX): New.
+	(X86_32_SSE_REGPARM_MAX): New.
+	(ix86_handle_cconv_attribute): Replace TARGET_64BIT_MS_ABI.
+	(ix86_function_regparm): Handle user calling abi.
+	(ix86_function_arg_regno_p): Replace TARGET_64BIT_MS_ABI
+	by DEFAULT_ABI versus SYSV_ABI check.
+	(ix86_reg_parm_stack_space): New.
+	(ix86_function_type_abi): New.
+	(ix86_call_abi_override): New.
+	(ix86_function_abi): New.
+	(ix86_cfun_abi): New.
+	(init_cumulative_args): Call abi specific initialization.
+	(function_arg_advance): Remove TARGET_64BIT_MS_ABI.
+	(function_arg_64): Extend SSE_REGPARM_MAX check.
+	(function_arg (): Remove TARGET_64BIT_MS_ABI.
+	(ix86_pass_by_reference): Likewise.
+	(ix86_function_value_regno_p): Likewise.
+	(function_value_64): Replace REGPARM_MAX, and SSE_REGPARM_MAX.
+	(ix86_function_value_1): Replace TARGET_64BIT_MS_ABI.
+	(return_in_memory_ms_64): Replace TARGET_64BIT_MS_ABI.
+	(ix86_build_builtin_va_list): Replace TARGET_64BIT_MS_ABI.
+	(setup_incoming_varargs_64): Adjust regparm for call abi.
+	(ix86_setup_incoming_varargs): Replace TARGET_64BIT_MS_ABI.
+	(ix86_va_start): Likewise.
+	(ix86_gimplify_va_arg): Likewise.
+	(ix86_expand_prologue): Likewise.
+	(output_pic_addr_const): Likewise.
+	(ix86_init_machine_status): Initialize call_abi by DEFAULT_ABI.
+	(x86_this_parameter): Replace TARGET_64BIT_MS_ABI.
+	(x86_output_mi_thunk): Likewise.
+	(x86_function_profiler): Likewise.
+	* config/i386/i386.h (TARGET_64BIT_MS_ABI): Use ix64_cfun_abi.
+	(SYSV_ABI, MS_ABI): New constants.
+	(DEFAULT_ABI): New.
+	(init_regs): Add prototype of function in regclass.c file.
+	(OVERRIDE_ABI_FORMAT): New.
+	(CONDITIONAL_REGISTER_USAGE): Remove TARGET_64BIT_MS_ABI part.
+	(REG_PARM_STACK_SPACE): Use ix86_reg_parm_stack_space.
+	(OUTGOING_REG_PARM_STACK_SPACE): New.
+	(ix86_reg_parm_stack_space): New prototype.
+	(CUMULATIVE_ARGS): Add call_abi member.
+	(machine_function): Add call_abi member.
+	* config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace TARGET_64BIT_MS_ABI
+	by DEFAULT_ABI compare to MS_ABI.
+
 2008-06-02  Andy Hutchinson  <hutchinsonandy@aim.com> 
 
 	PR target/34879


The results can be reproduced by building a compiler with

--enable-gather-detailed-mem-stats targetting x86-64

and compiling preprocessed combine.c or testcase from PR8632 with:

-fmem-report --param=ggc-min-heapsize=1024 --param=ggc-min-expand=1 -Ox -Q

The memory consumption summary appears in the dump after detailed listing
of the places they are allocated in.  Peak memory consumption is actually
computed by looking for maximal value in {GC XXXX -> YYYY} report.

Your testing script.


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