The following program allocates memory to two arrays ia and ib. It then attempts to deallocate the memory in ib, but after (admittedly confusingly) renaming it ia in the USE statement. However, it is actually ia that gets deallocated. That seems to me to be a bug.
! This program appears to deallocate the wrong array.
MODULE m1
INTEGER, DIMENSION(:), ALLOCATABLE :: ia
INTEGER, DIMENSION(:), ALLOCATABLE :: ib
END MODULE m1
MODULE m2
CONTAINS
SUBROUTINE s1 ()
USE m1, ONLY: ia
ALLOCATE (ia(2))
END SUBROUTINE s1
SUBROUTINE s2 ()
USE m1, ONLY: ib
ALLOCATE (ib(2))
END SUBROUTINE s2
SUBROUTINE s3 ()
USE m1, ONLY: ia=>ib
DEALLOCATE (ia)
END SUBROUTINE s3
END MODULE m2
PROGRAM p
USE m1
USE m2
CALL s1 ()
CALL s2 ()
CALL s3 ()
PRINT *, ALLOCATED(ia),ALLOCATED(ib)
END PROGRAM p