https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68829
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org --- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- > > But it's also that you are asking for it with -Ofast. Maybe the frontend > > should have a switch to specifiy a size limit? > > Good idea, any volunteer? It seems that -fmax-stack-var-size=N does not override -Ofast. Maybe it should. ig25@linux-fd1f:/tmp> cat a.f90 real, dimension(10**6) :: a call random_number(a) write (*,*) a end ig25@linux-fd1f:/tmp> gfortran -fdump-tree-original -Ofast -fmax-stack-var-size=10000 a.f90 ig25@linux-fd1f:/tmp> head a.f90.003t.original MAIN__ () { static real(kind=4) a[1000000]; { struct array1_real(kind=4) parm.0; parm.0.dtype = 281; parm.0.dim[0].lbound = 1; parm.0.dim[0].ubound = 1000000; ig25@linux-fd1f:/tmp>