This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Missing Finalizations - was [patch, fortran] Implement simplification of minloc and maxloc


Hi Thomas,

In an email from Tobias in 2014:
*******
Without looking at the PRs, just from recalling:

A = ...

LHS of an assignment is not finalized before the assignment (has to be
done for both allocatable an nonallocatable variables). Exception: If
"A" is not finalizable but has finalizable components, those are
already finalized.

Expressions – those are effectively:
   call foo(f())
and
   A = f()

where f() returns something finalizable. It probably applies to both
nonpointer, nonallocatable derived types and to allocatable derived
types. For allocatable scalars, we always leak memory.

I think move_alloc is already handled, I don't recall issues with
intrinsics or with intent(out). Thus, I think that's the complete
list.


There is somewhere a PR which shows that the finalization wrapper does
not work properly for nested array derived types. I forgot whether it
ICEs or whether it just doesn't finalize enough.
*******

Cheers

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]