https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121043
--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- I narrowed it down. I modified with some convenient prints: program register3 implicit none integer, parameter :: invalid_rank=-2 integer :: np=invalid_rank,array_size=10 integer,allocatable :: array(:)[:] np = num_images() allocate(array(array_size)[*],source=this_image()) block logical :: res = .true. if(this_image() == 1) then if(size(array) /= array_size) error stop "Test failed." endif print *, this_image(), "before deallocate" deallocate(array) print *, this_image(), "after deallocate" !if(allocated(array)) print *, "Test failed." ! It's hanging on the 'allocated' if(this_image() == 1) print *,"Test passed." end block end program $ ../opencoarrays-clean/bin/caf register_alloc_vector.f90 $ ../opencoarrays-clean/bin/cafrun -np 2 ./a.out 1 before deallocate 2 before deallocate 1 after deallocate Test passed. 2 after deallocate Uncomment that one line and it hangs.