https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78505

--- Comment #1 from Damian Rouson <damian at sourceryinstitute dot org> ---
Section 9.7.1.2, paragraph 4, of the draft Fortran 2015 standard [1]:

"When an ALLOCATE statement is executed for which an allocate-object is a
coarray, there is an implicit synchronization of all active images in the
current team. On those images, if no error condition other than
STAT_STOPPED_IMAGE or STAT_FAILED_IMAGE occurs, execution of the segment
(11.6.2) following the statement is delayed until all other active images in
the current team have executed the same statement the same number of times in
this team. The coarray shall not become allocated on an image unless it is
successfully allocated on all active images in this team."

The important point is that no image can execute the segment following the
ALLOCATE statement until every image has executed the ALLOCATE statement the
same number of times (once in the example submitted in PR 78505). Because the
"SOURCE=" is part of the ALLOCATE statement, the action indicated by the
"SOURCE=" must complete on every image before any image can execute code that
comes after the corresponding ALLOCATE.

[1] http://open-std.org/JTC1/SC22/WG5/5559

Reply via email to