[Patch, Fortran] Deregister allocatable COARRAYS, fixes to (de)allocate
Tobias Burnus
burnus@net-b.de
Fri Dec 30 14:08:00 GMT 2011
Dear all,
first, I want to wish all of you a happy New Year.
Attached you find a patch which calls _gfortran_caf_deregister for
allocatable coarrays - for -fcoarray=lib. In the caf libraray version,
coarrays are allocated/deallocated in the library. The
allocation/deallocation was working before for coarrays in static memory
("SAVE") and the ALLOCATE ("register") of allocatable coarrays. This
patch adds the deallocation support ("deregister") both for explicit
(DEALLOCATE) as well as for the implicit deallocation (when leaving the
scope).
While implementing this, I fixed and changes some other items:
* The "token" which identifies the coarray in the library was not
properly implemented in the library.
* ERRMSG= of ALLOCATE/DEALLOCATE did not pad the string
* ALLOCATE of coarrays with -fcoarray=lib: The status and errmsg of
_gfortran_caf_register were overridden.
Instead of counting the deallocate failures, we now directly abort,
which makes life a bit easier which coarrays. (Without coarrays, the
only failure can be that the variable is already deallocated as "free()"
does not give an error and we currently do not check whether pointer
targets may be deallocated. With coarrays, additional issues can occur.)
Build and regtested on x86-64-linux.
OK for the trunk?
Tobias
PS: Regarding the stat= value, I got confused and ask at
http://j3-fortran.org/pipermail/j3/2011-December/004948.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dealloc-v5.diff
Type: text/x-patch
Size: 46796 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111230/0e9a685e/attachment.bin>
More information about the Fortran
mailing list