[Patch, Fortran] Coarrays: Don't (free)/alloc LHS coarray components on assignment
Tobias Burnus
burnus@net-b.de
Wed Jun 26 21:00:00 GMT 2013
Tobias Burnus wrote:
> With coarrays, allocation/deallocation of coarrays requires a
> synchronization with all other images. Thus, the standard restricts
> changing the allocation status to: ALLOCATE and DEALLOCATE statements
> plus end-of-scope deallocation.
>
> In particular, with intrinsic assignment the allocation status does
> not change. Hence, there is no realloc on assignment. But also (this
> patch!) no deallocation/allocation of allocatable components during
> intrinsic assignment of derived types. [This implies that the LHS
> componet has to have the same allocation status, shape,
> type-parameters and actual type as the RHS.]
>
> The patch additionally checks whether end-of-scope deallocation of
> coarrays properly calls the deregister function (it did/does).
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?
Update: I forgot to copy the back the address of the allocated CAF -
which lead to an unwanted address sharing between the RHS and LHS.
Note: structure_alloc_comps also contains bits from
http://gcc.gnu.org/ml/fortran/2013-06/msg00131.html
Build and regtested on x86-64-gnu-linux.
OK for the trunk?
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: caf_norealloc-v2.diff
Type: text/x-patch
Size: 15142 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130626/1d12ba2b/attachment.bin>
More information about the Fortran
mailing list