https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127738
--- Comment #3 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:89058eb24376fe0d25ed586fab86b691672eb45d commit r17-5300-g89058eb24376fe0d25ed586fab86b691672eb45d Author: Jerry DeLisle <[email protected]> Date: Mon Oct 5 11:14:03 2026 -0700 libgfortran: [PR127738] caf_shmem: give every team its own id The id of a team's shared data was computed from the team number and a count of FORM TEAM statements per image, which collided between teams and differed between the images of a team. Each team now takes its id from a counter in the supervisor, looked up per FORM TEAM statement of the parent team, and the ids of its coarrays are derived from it. Assisted-by: Claude Opus 5.5 PR libfortran/127738 libgfortran/ChangeLog: * caf/shmem.c (new_team_id): New function. (_gfortran_caf_form_team): Use it. Count the FORM TEAM statements of the current team. (_gfortran_caf_change_team): Derive the coarray ids from the team's id. * caf/shmem/supervisor.c (ensure_shmem_initialization): Initialize the id of the initial team and the next team id. * caf/shmem/supervisor.h (struct supervisor): Add next_team_id. * caf/shmem/teams_mgmt.h (struct caf_shmem_team): Add teams_formed. (struct shmem_image_info): Replace lastmemid by id. Add new_teams and new_teams_gen. gcc/testsuite/ChangeLog: * gfortran.dg/coarray/form_team_ids_1.f90: New test.
