Re: [PATCH] Add NON_RECURSIVE attribute for procedures

2017-12-22 Thread Thomas Koenig
Hi Janne, I think, in general, our current system where -std=gnu means roughly "everything we have implemented so far, except legacy extensions that break standards conformance" is pretty good. The problem that I see with implementing this change is stack space, especially the traditionally li

Re: [PATCH] Add NON_RECURSIVE attribute for procedures

2017-12-21 Thread Janne Blomqvist
On Wed, Dec 20, 2017 at 11:37 PM, Thomas Koenig wrote: > Hi Janne, > > I think you need a few more test cases, like (compile with -fcheck=all > and -std=f2018): > > module foo > contains > subroutine f(n) > call g(n-1) > end subroutine f > subroutine g(n) > if (n<0) return > call

Re: [PATCH] Add NON_RECURSIVE attribute for procedures

2017-12-20 Thread Thomas Koenig
Hi Janne, I think you need a few more test cases, like (compile with -fcheck=all and -std=f2018): module foo contains subroutine f(n) call g(n-1) end subroutine f subroutine g(n) if (n<0) return call f(n-1) end subroutine g end module foo program main use foo call f(10) e

[PATCH] Add NON_RECURSIVE attribute for procedures

2017-12-19 Thread Janne Blomqvist
Fortran 2018 makes procedures recursive by default (effectively making the existing RECURSIVE attribute a no-op). Instead it adds a NON_RECURSIVE attribute that a programmer can use to mark a procedure that may not be called recursively. This patch adds support for that. Regtested on x86_64-pc-l