https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86050
--- Comment #5 from Konstantin Kharlamov <Hi-Angel at yandex dot ru> --- (In reply to Konstantin Kharlamov from comment #4) > Works for me on gcc 9.1.0. I compile it as: > > $ g++ test.cpp -o a -O2 > > And then running `./a` results in a bunch of: > > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes > Consumed 80 bytes Just tested with 8.3.0 version on the other PC, same there, i.e. stack space does not increase when built with -O2. So this was fixed at least since 8.3.0.