Bug 45201 - ICE: stack overflow
Summary: ICE: stack overflow
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: GC, ice-on-valid-code
Depends on:
Reported: 2010-08-05 21:50 UTC by d534882
Modified: 2011-04-16 17:12 UTC (History)
2 users (show)

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Known to work:
Known to fail:
Last reconfirmed:

preprocessed source file (214.94 KB, application/x-bzip2)
2010-08-05 21:53 UTC, d534882
g++ -v / g++ proto_fusion.cpp -std=c++0x -g output (355 bytes, text/plain)
2010-08-05 21:54 UTC, d534882
cc1plus invocation commands (203 bytes, text/plain)
2010-08-07 20:00 UTC, d534882
gdb backtrace (74.86 KB, application/x-bzip2)
2010-08-07 20:01 UTC, d534882
another testcase (390.23 KB, application/x-bzip2)
2010-08-11 20:01 UTC, d534882

Note You need to log in before you can comment on or make changes to this bug.
Description d534882 2010-08-05 21:50:52 UTC
The attached code will lead to a stack overflow if compiled with -std=c++0x and -g . The code compiles fine without -g. gcc-4.5.0 accepts the code just fine as well, even when compiled with -g.
Comment 1 d534882 2010-08-05 21:53:16 UTC
Created attachment 21413 [details]
preprocessed source file
Comment 2 d534882 2010-08-05 21:54:28 UTC
Created attachment 21414 [details]
g++ -v / g++ proto_fusion.cpp -std=c++0x -g output
Comment 3 Richard Biener 2010-08-06 10:37:42 UTC
Works for me on x86_64-linux with -m32.
Comment 4 d534882 2010-08-07 19:58:54 UTC
I am able to reproduce this stack overflow with other source files as well - even somtimes when compiling without "-g" .
Comment 5 d534882 2010-08-07 20:00:11 UTC
Created attachment 21433 [details]
cc1plus invocation commands
Comment 6 d534882 2010-08-07 20:01:26 UTC
Created attachment 21434 [details]
gdb backtrace
Comment 7 Andrew Pinski 2010-08-11 00:16:02 UTC
(In reply to comment #6)
> Created an attachment (id=21434) [edit]
> gdb backtrace

Hmm, GGC strikes again.  Well really a small stack size on windows strikes with GGC.
Comment 8 d534882 2010-08-11 20:00:04 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Created an attachment (id=21434) [edit]
> > gdb backtrace
> > 
> Hmm, GGC strikes again.  Well really a small stack size on windows strikes with
> GGC.

I added another testcase. When compiled with -O0 -g -std=c++0x on i686-mingw32, 3-stage bootstraped with "-g0 -O3 -fomit-frame-pointer", the reserved stack size of cc1plus must be between 8,3MB and 9,4MB. The default reserved stack size is about 2,09MB.
Comment 9 d534882 2010-08-11 20:01:10 UTC
Created attachment 21456 [details]
another testcase
Comment 10 Dave Korn 2010-12-11 16:08:37 UTC
Should be fixed for 4.6.0: compiler stack size was increased to 12MB by:

Comment 11 d534882 2011-04-16 17:12:57 UTC
Fixed in 4.6.0