[Patch, fortran] PR41706 - [OOP] Calling one TBP as an actual argument of another TBP

Paul Richard Thomas paul.richard.thomas@gmail.com
Mon Oct 19 04:52:00 GMT 2009


Dear All,

The PR comes about because of the use of static variables in the
resolution of typebound procedures in classes.  If calls to these
procedures are nested by having actual argument expressions involving
such calls, then an internal compiler error ensues.  The fix is simply
to resolve the actual argument expressions first.

Bootstrapped and regtested on FC9/x86_64

The original testcase had the allocation within subroutine 's'.  This
segfaults at -O2, with the fourth, extra test, because the allocation
is optimized away.  I will investigate and raise a separate PR.

Cheers

Paul

2009-10-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41706
	* resolve.c (resolve_arg_exprs): New function.
	(resolve_class_compcall): Call the above.
	(resolve_class_typebound_call): The same.

2009-10-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41706
	* gfortran.dg/class_9 : New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-patch
Size: 3297 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091019/dfbbd562/attachment.bin>


More information about the Fortran mailing list