https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121384
Ivan Pribec <ivan.pribec at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ivan.pribec at gmail dot com
--- Comment #4 from Ivan Pribec <ivan.pribec at gmail dot com> ---
I encountered the same problem with arrays of intrinsic types,
! Swapping arrays using associate
! Expected output: a = 4 5 6, b = 1 2 3
! Workaround: associate (tmp => [a]) forces the copy (rank-1 only).
program assoc_paren_swap
implicit none
integer :: a(3), b(3)
a = [1, 2, 3]
b = [4, 5, 6]
associate (tmp => (a))
a = b
b = tmp
end associate
print *, "a = ", a
print *, "b = ", b
if (any(a /= [4, 5, 6]) .or. any(b /= [1, 2, 3])) then
print '(a)', 'FAIL: parenthesized selector was not copied'
error stop 1
end if
end program