https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127208
Bug ID: 127208
Summary: Teams don't work correctly with -fcoarray=single
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: mikael at gcc dot gnu.org
Target Milestone: ---
See the thread starting at [1], especially Jerry's detailed answer [2].
Testcase:
program prog
use, intrinsic :: iso_fortran_env, only: team_type
implicit none
type(team_type) :: team
print *, team_number()
form team (12, team)
change team(team)
print *, team_number()
end team
print *, team_number()
end program
expected output (for each image):
-1
12
-1
Current output with -fcoarray=single:
-1
[1] https://gcc.gnu.org/pipermail/fortran/2026-September/064581.html
[2] https://gcc.gnu.org/pipermail/fortran/2026-September/064587.html