https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81265
Bug ID: 81265 Summary: allocatable coarrays in submodule subroutines wrongly identified as unallocated Product: gcc Version: 7.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mexas at bristol dot ac.uk Target Milestone: --- Created attachment 41655 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41655&action=edit m.f90 sm.f90 m2.f90 p.f90 - 4 Fortran 2008 files Sorry I cannot yet reduce this further. m.f90 - module 1 sm.f90 - submodule of module 1 m2.f90 - module 2 p.f90 - program that uses both modules: m and m2. submodule sm has subroutine s, which is passed as one actual argument subroutine s2 from module m2. An allocatable coarray is allocated in the program p. Then subroutine s is called with s2 passed in. In s the allocatable coarray is seen as allocated, but when it is passed further to s2 from 2, in s2 it is seen as not allocated. To build/run: rat> caf -c m.f90 m2.f90 sm.f90 p.f90 rat> caf p.o m.o m2.o sm.o rat> cafrun -np 4 ./a.out ERROR: s2: coarray is not allocated ERROR: s2: coarray is not allocated ERROR: s2: coarray is not allocated ERROR: s2: coarray is not allocated ERROR STOP ERROR STOP ERROR STOP rat> rat> caf --version OpenCoarrays Coarray Fortran Compiler Wrapper (caf version 1.9.0) Copyright (C) 2015-2016 Sourcery, Inc. OpenCoarrays comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of OpenCoarrays under the terms of the BSD 3-Clause License. For more information about these matters, see the file named LICENSE. rat> caf -w caf wraps CAFC=/usr/local/bin/mpif90 rat> mpif90 --version GNU Fortran (FreeBSD Ports Collection) 7.0.1 20170326 (experimental) Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Shall I send this to OpenCoarrays instead? ifort 16 runs this program with no error.