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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

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

2019-10-23  Steven G. Kargl  <[hidden email]>

        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  <[hidden email]>

        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

pr92178.diff (2K) Download Attachment