This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66603] using std::cout causes segfault with unrelated array declaration
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Jun 2015 20:10:00 +0000
- Subject: [Bug c++/66603] using std::cout causes segfault with unrelated array declaration
- Auto-submitted: auto-generated
- References: <bug-66603-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66603
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to gunney1 from comment #3)
> Because of the effects of the stream insertion. But maybe I don't
> understand very well their relationship.
First, I guess it does not crash with icpc because icpc optimizes by default.
g++ -O also optimizes 'a' away.
Simply mentioning a huge stack array does not produce the crash. The issue is
when something (anything, in this case placing the arguments for the function
call) tries to use the stack after that array (outside of the stack, since the
array is so large).