Does gcc automatically lower optimization level for very large routines?

Segher Boessenkool segher@kernel.crashing.org
Wed Jan 1 15:20:00 GMT 2020


On Tue, Dec 31, 2019 at 09:25:01PM -0800, Andi Kleen wrote:
> Would be useful to figure out in more details where the memory
> consumption goes in your test case.
> 
> Unfortunately gcc doesn't have a good general heap profiler,
> but I usually do (if you're on Linux). Whoever causes most page
> faults likely allocates most memory.
> 
> perf record --call-graph dwarf -e page-faults gcc ...
> perf report --no-children --percent-limit 5 --stdio > file.txt
> 
> and post file.txt into a bug in bugzilla.

There also is the last column of -ftime-report (amount of GC memory
alocated in each pass), it often is helpful.


Segher



More information about the Gcc mailing list