[Patch, fortran]Pr30876 - Array valued recursive function rejected

Paul Richard Thomas paul.richard.thomas@gmail.com
Tue May 8 19:53:00 GMT 2007


:ADDPATCH fortran:

The explanation for this patch is to be found at comment #3 on the PR
- thanks, Tobias.  It appears that I got PR27613 completely wrong -
this should have been invalid code.  The rule is simple:

"12.5.2.1 Function subprogram"
"If RESULT is not specified, the result variable is <function- name> and all
occurrences of the function name in execution-part statements are references to
the result variable."

This is what this patch implements.... I hope:)  The testcase for
PR27613 has been corrected and Joost's testcase added (BTW Joost,
thanks for reporting the testcases in standard form, ready for the
testsuite.).

Regtested on x86_ia64/FC5 - OK for trunk?

Paul

2007-05-08  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30876
	* trans-expr.c (gfc_conv_function_call): Reduce indirection for
	direct assignments of recursive array valued functions.
	* primary.c (gfc_match_rvalue): Correct error for recursive
	function calls such that directly recursive calls of scalar
	function without an explicit result are disallowed.

2007-05-08  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30876
	* gfortran.dg/recursive_reference_1.f90: Put error at correct
	line.
	* gfortran.dg/recursive_reference_2.f90: New test.


-- 
"Success is the ability to go from one failure to another with no loss
of enthusiasm."  -  Winston Churchill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30876.diff
Type: text/x-patch
Size: 5569 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070508/bc89a3cd/attachment.bin>


More information about the Fortran mailing list