[Patch, fortran] PR27613 - Recursive functions

Paul Thomas paulthomas2@wanadoo.fr
Sun May 21 13:42:00 GMT 2006


:ADDPATCH fortran:

This patch fixes PR27613 in which directly recursive, scalar functions 
were generating an "unclassifiable statement" error for the recursive 
statement(s).  What I mean by "direct" here is that there is no RESULT 
in the function statement.  The fix is effected in gfc_match_rvalue by 
detecting the left parenthesis for the function argument, generating an 
error if the symbol represents an array and generates the recursive 
function reference, otherwise.

Regtested on Cygwin_NT/PIV.

OK for trunk and 4.1, when it reopens?

Paul

2006-05-21  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/27613
    * primary.c (gfc_match_rvalue): Test if symbol represents a
    direct recursive function reference.  Error if array valued,
    go to function0 otherwise.

2006-05-21  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/27613
    * gfortran.dg/recursive_reference_1.f90: New test.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr27613.diff
Type: text/x-patch
Size: 871 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060521/299ffa4d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recursive_reference_1.f90
Type: text/x-fortran
Size: 1332 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060521/299ffa4d/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Change.Logs
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060521/299ffa4d/attachment.ksh>


More information about the Gcc-patches mailing list