https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127837
--- Comment #2 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:5d74e9640ebebb10abab61cfd20631dbe6a97dcc commit r17-5127-g5d74e9640ebebb10abab61cfd20631dbe6a97dcc Author: Jerry DeLisle <[email protected]> Date: Mon Oct 5 18:13:33 2026 -0700 libgfortran: [PR127837] Set END TEAM STAT= for stopped and failed images With caf_shmem, END TEAM always returned STAT=0 because _gfortran_caf_end_team synchronized with sync_team, which does not report stopped or failed images. Without STAT= such an image did not cause error termination either, as F2023 11.7.11 requires. END TEAM now takes the number of terminated images from the barrier round and runs TEAM_HEALTH_CHECK on the ended team after deallocating its coarrays; counter_barrier_wait gains a TERMINATED argument for this. Existing tests that end a team containing a stopped or failed image now give END TEAM a STAT= variable. Assisted-by: Claude Opus 5.5 PR libfortran/127837 libgfortran/ChangeLog: * caf/shmem.c (_gfortran_caf_end_team): Wait with counter_barrier_wait and set STAT= with TEAM_HEALTH_CHECK when an image of the team stopped or failed. Do not pass STAT= to _gfortran_caf_deregister. * caf/shmem/counter_barrier.c (counter_barrier_wait): Add TERMINATED argument. * caf/shmem/counter_barrier.h (counter_barrier_wait): Likewise. * caf/shmem/sync.c (sync_team): Update call. gcc/testsuite/ChangeLog: * gfortran.dg/coarray/signal_team_1.f90: Add STAT= to END TEAM. * gfortran.dg/coarray/stop_end_team_1.f90: Likewise and check it. * gfortran.dg/coarray/stop_sync_team_1.f90: Likewise. * gfortran.dg/coarray/end_team_stat_1.f90: New test. * gfortran.dg/coarray/end_team_stat_2.f90: New test.
