https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84386
Harald Anlauf <anlauf at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
CC| |anlauf at gcc dot gnu.org
--- Comment #5 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
As expected, this issue should also affect ASSOCIATE:
program foo
call block3
end program foo
subroutine block3
!integer :: i ! uncomment this and the code works
j = 1
associate (k => j)
i = 42 ! i is implicitly declared in subroutine block3
k = 42
end associate
print *, i, j
if (i /= 42) stop 1 ! i should be 42
if (j /= 42) stop 2
print *, "block3 passed"
end subroutine block3
prints:
0 42
STOP 1
(The 0 can be any random stuff.)