> We noticed that when analyzing LTRANS memory peak that happens right > after the start: > https://gist.github.com/marxin/223890df4d8d8e490b6b2918b77dacad > > In case of chrome, we have symtab->order == 200M, so we allocate > 16B * 200M = 3.2GB.
200M is very large number even for overall number of symbols (and close to overflow), so I guess we want to start adding overflow checks and turn some stuff to 64bit... There are many unnecesary orders assigned, so I will take care of this first. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > * cgraph.h: Remove leading empty lines. > * cgraphunit.c (enum cgraph_order_sort_kind): Remove > ORDER_UNDEFINED. > (struct cgraph_order_sort): Add constructors. > (cgraph_order_sort::process): New. > (cgraph_order_cmp): New. > (output_in_order): Simplify and push nodes to vector. OK Honza