https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91413
Bug ID: 91413 Summary: [F2018]: Procedures are recursive by default; switching from stack to static allocation is not safe Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jb at gcc dot gnu.org Target Milestone: --- As of Fortran 2018, procedures are recursive by default. However, currently GFortran places automatic arrays larger than the limit specified by -fmax-stack-var-size= (default 32768 bytes(?)) in static memory, which breaks reentrancy and thread-safety. Removing this outright, in effect making -frecursize the default, is probably not OK either as that would cause many applications to crash due to exhausting stack space. The remaining option then would be to switch to using heap memory rather than static memory for local arrays going over the limit. For a thread on this topic, see https://gcc.gnu.org/ml/fortran/2017-12/msg00082.html