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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jerry DeLisle <[email protected]>:

https://gcc.gnu.org/g:909075f102c0ddd8568c6871c03d1dce027ced32

commit r17-4660-g909075f102c0ddd8568c6871c03d1dce027ced32
Author: Jerry DeLisle <[email protected]>
Date:   Thu Sep 24 12:39:51 2026 -0700

    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.

    Assisted-by: Claude Opus 5

            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.

Reply via email to