Bug 52052 - [Coarray] Properly handle coarray components of derived types
Summary: [Coarray] Properly handle coarray components of derived types
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks: 52403
  Show dependency treegraph
 
Reported: 2012-01-30 14:13 UTC by Tobias Burnus
Modified: 2013-07-22 17:29 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2012-01-30 14:13:40 UTC
Special care needs to be taken with coarrays - and in particular coarray components; they may only be collectively allocated and deallocated.

In particular:

Intrinsic assignment: Contrary to normal allocatable components,
no reallocation is allowed. The programmer guarantees that the shape and
type parameters are suitable.

Caveat: Be aware of allocatable components nested within coarray components - and issues with polymorphism.

Please also check that:
- Calling caf_register is done with ALLOCATE, also with SOURCE=
- Calling of caf_deregister when leaving the scope/calling DEALLOCATE
- Special handling of polymorphic coarray components
- Whether there are issues regarding _def_init and _copy; cf. PR 51947. Consider whether a simple INTENT_INOUT for _copy would be more appropriate.
- Check that there is indeed no realloc on assignment for coarray variables.
Comment 1 Tobias Burnus 2013-07-22 17:27:14 UTC
(In reply to Tobias Burnus from comment #0)
> Intrinsic assignment: Contrary to normal allocatable components,
> no reallocation is allowed. The programmer guarantees that the shape and
> type parameters are suitable.

Patches:
- http://gcc.gnu.org/ml/fortran/2013-06/msg00137.html (committed)
- http://gcc.gnu.org/ml/fortran/2013-07/msg00041.html (committed)
Comment 2 Tobias Burnus 2013-07-22 17:29:53 UTC
Author: burnus
Date: Mon Jul 22 17:28:56 2013
New Revision: 201140

URL: http://gcc.gnu.org/viewcvs?rev=201140&root=gcc&view=rev
Log:
2013-07-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57906
        PR fortran/52052
        * class.c (gfc_build_class_symbol): Set coarray_comp.
        * trans-array.c (structure_alloc_comps): For coarrays,
        directly use the data pointer address.

2013-07-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57906
        PR fortran/52052
        * coarray/lib_realloc_1.f90: Permit optimization.
        * gfortran.dg/coarray_31.f90: New.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/class.c
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/coarray/lib_realloc_1.f90