This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/70599] Crash when adding debug symbols to a program making heavy use of nested templates.
- From: "ambrop7 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 09 Apr 2016 00:31:57 +0000
- Subject: [Bug debug/70599] Crash when adding debug symbols to a program making heavy use of nested templates.
- Auto-submitted: auto-generated
- References: <bug-70599-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70599
Ambroz Bizjak <ambrop7 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ambrop7 at gmail dot com
--- Comment #4 from Ambroz Bizjak <ambrop7 at gmail dot com> ---
Hi,
(I'm the author of Aprinter)
I find that with -g1 instead of -g, the compile works fine. I've managed to
refactor the code so that gcc compiles it with -g, using up to 8.5 GiB. The
resulting .elf file is 627M (with -g1 16M, without -g 437K).
It takes gdb about a minute to load the full file, and memory use of gdb grows
to gigabytes.
I suspect that the issue with -g is that gcc includes ALL types in the output,
including types used only for metaprogramming. Probably for every list like
Cons<1, Cons<2, Cons<3>>> there will be a quadratic explosion all constituent
lists are included as symbols in the output, which is very bad for non-trivial
lists.
Clang manages to compile the same thing (with -g) using 1GiB RAM and results in
a 181M .elf output.