https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103970
Bug ID: 103970 Summary: Multi-image co_broadcast of derived type with allocatable components fails Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: damian at sourceryinstitute dot org Target Milestone: --- Using gfortran 11.2.0 installed by Homebrew on macOS 12.0.1 to compile the code below and link against OpenCoarrays 2.9.2 built with MPICH 3.2.0 results in printing "Test failed." when executed in multiple images. implicit none type foo_t integer i integer, allocatable :: j end type type(foo_t) foo integer, parameter :: source_image = 1 if (this_image() == source_image) then foo = foo_t(2,3) else allocate(foo%j) end if call co_broadcast(foo, source_image) if ((foo%i /= 2) .or. (foo%j /= 3)) error stop "Test failed." sync all print *, "Test passed." end This bug is also summarized in OpenCoarrays issue 727 at https://github.com/sourceryinstitute/OpenCoarrays/issues/727, where Andre Vehreschild confirms that the problem is a compiler bug.