[PATCH] PR fortran/92178 -- Re-order argument deallocation

Steve Kargl sgk@troutmask.apl.washington.edu
Wed Oct 23 18:12:00 GMT 2019


The attached patch has been tested on x86_64-*-freebsd.  OK to commit?

2019-10-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/92178
	* trans-expr.c (gfc_conv_procedure_call): Evaluate args and then
	deallocate actual args assocated with intent(out) dummies.

2019-10-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/92178
	* gfortran.dg/pr92178.f90: New test.

Note, in gfc_conv_procedure_call() there are 3 blocks of 
code that deal with the deallocation of actual arguments
assocated with intent(out) dummy arguments.  The patch
affects the first and third blocks.  The 2nd block, lines
6071-6111, concerns CLASS and finalization.  I use neither,
so have no idea what Fortran requires.  More importantly,
I have very little understanding of gfortran's internal
implementation for CLASS and finalization.  Someone who
cares about CLASS and finalization will need to consider
how to possibly fix a possible issue.

-- 
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr92178.diff
Type: text/x-diff
Size: 2292 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20191023/b20e572e/attachment.bin>


More information about the Fortran mailing list