This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] RFC: PR fortran/37779, diagnose "missing" recursive


Steve Kargl wrote:
> On Sun, Nov 16, 2008 at 01:09:10PM +0100, Daniel Kraft wrote:
>   
>>  On the other hand, I guess this could lead to rejects-valid situations 
>> and we should think about F77 compatibility where the solution of adding 
>> "RECURSIVE" is not available.
>>     
> I may not have understood what is written above.  It seems you
> want to permit recursion without the RECURSIVE keyword to 
> possibly allow Fortran 77 corner cases.

I agree that standard-conforming Fortran 77 cannot have recursive
procedures, but there are legacy programs out there which use recursion.

However, if one uses recursion without RECURSIVE one needs to be utterly
careful as local variables might end up in static memory instead of on
the stack, which of cause leads to wrong results; for such programs one
can use -frecursive. (Actually, if the local variable is an array, it
indeed might end up on the stack; or if one uses -fautomatic.)

I would not completely reject recursive programs, but one could consider
to only allow it with -std=legacy and one should point in the error
message to -std=legacy and -frecursive.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]