https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66603
--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> --- Another detail that might confuse you: if you write in n=4000000; int a[n]; it will probably not crash. The reason is that variables like 'int a[4000000]' exist for the whole length of the function, the memory for them is reserved at function entry, so the stream operation happens after the memory was reserved. On the other hand, a dynamic allocation (VLA) happens at the point where it is requested, i.e. after the stream op, and there is no operation afterwards to use the stack and crash the program.