https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124817
Bug ID: 124817
Summary: Unreasonably high memory usage (>50 GB) when compiling
simple C++ code with recursive calls
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiago at skewed dot de
Target Milestone: ---
Created attachment 64174
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64174&action=edit
Minimal test case.
Please see the minimal test case attached, to be compiled with:
g++ --std=gnu++23 -g test.cc -o test
Memory usage during compilation seems grows exponentially when using -g if the
recursion depth of the function being called increases, even though the tuple
added has length one, which does not change the total number of dispatches.
For a recursion level 12 I need upwards of 50GB to compile.
The problem disappears without -g, or when using clang++ (with or without -g).