The master branch has been updated by Jerry DeLisle <[email protected]>:
https://gcc.gnu.org/g:909075f102c0ddd8568c6871c03d1dce027ced32
On 9/25/26 1:23 AM, Mikael Morin wrote:
Le 25/09/2026 à 03:14, Jerry DeLisle a écrit :
See the attached patch.
This takes care of the STAT= problem identified here:
https://gcc.gnu.org/pipermail/fortran/2026-September/064686.html
Regression tested on x86_64.
OK for mainline?
Regards,
Jerry
---
libgfortran: [PR127347] caf_shmem: report a terminated image
in a collective
A collective subroutine whose barrier was abandoned because an image of
the team terminated reported this with a runtime error, and so
terminated the remaining images even when a STAT argument was present.
F2023 16.6 assigns STAT_STOPPED_IMAGE, or STAT_FAILED_IMAGE, to the
STAT argument in that case and leaves the A argument undefined; an
error condition without a STAT argument still is error termination.
Pass the abandoned barrier up to the collective and classify it the
same way an image control statement does.
PR libfortran/127347
libgfortran/ChangeLog:
* caf/shmem.c (_gfortran_caf_co_broadcast, _gfortran_caf_co_sum)
(_gfortran_caf_co_min, _gfortran_caf_co_max)
(_gfortran_caf_co_reduce): Report a terminated image of the team
through STAT.
* caf/shmem/collective_subroutine.c (collsub_sync): Return whether
the images were synchronized.
(collsub_reduce_array, collsub_broadcast_array): Likewise. Give up
when an image of the team terminated.
* caf/shmem/collective_subroutine.h (collsub_reduce_array)
(collsub_broadcast_array): Adjust.
gcc/testsuite/ChangeLog:
* gfortran.dg/coarray/collective_stopped_2.f90: New test.
---
OK. That was fast.