https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109695

--- Comment #20 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Jakub Jelinek from comment #17)
> Or just try to check for functions with largest stack usages in cc1plus?
> Doing that on the trunk gives:
> objdump -dr cc1plus | grep
> '>:\|sub.*0x.*[0-9a-f][0-9a-f][0-9a-f][0-9a-f],.*rsp' | awk
> '/>:/{I=$2}/sub.*rsp/{J=gensub(/.*(0x[0-9a-f]+),%rsp/,"\\1","1",$0);
> K=strtonum(J);printf "%d %s %s\n", K, I, $0}' | grep -v 0xffffffffffff |
> sort -nr
> 410440 <_ZN19infer_range_manager17register_all_usesEP9tree_node>:  275120d:
> 48 81 ec 48 43 06 00  sub    $0x64348,%rsp

That's 410K on the stack. Eek !

It looks to me like the data needs to go into the heap. RAII will help
with tidyup.

> Usual Linux stack is around 8MB, but e.g. on Windows I think just 2MB.

Linux kernel has a script checkstack.pl. This might help.

I will try an experimental build of gcc with -Wstack-usage=100000 and report
back.

Reply via email to