This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68546] passing non-contiguous associated array section garbles results
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Nov 2015 07:27:41 +0000
- Subject: [Bug fortran/68546] passing non-contiguous associated array section garbles results
- Auto-submitted: auto-generated
- References: <bug-68546-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68546
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tkoenig at gcc dot gnu.org
Depends on| |64773
--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
We're missing an internal_pack here.
This works, as expected:
module x
contains
subroutine foo(A_sect)
real :: A_sect(:)
write(*, '(3(1x,f5.1))') A_sect(:)
end subroutine foo
end module x
program assoc
use x
integer :: i, j
real :: A(3,3)
do j = 1, 3
do i = 1, 3
A(i,j) = 100.0*i + j
end do
end do
write(*,'(a)') 'write statement with fixed i section'
write(*, '(3(1x,f5.1))') A(2,:)
write(*,'(a)') '----------'
write(*,'(a)') 'calling foo with fixed i section'
call foo(A(2,:))
write(*,'(a)') '----------'
write(*,'(a)') 'write statement with associated fixed i section'
associate( A2 => A(2,:) )
write(*, '(3(1x,f5.1))') A2
end associate
write(*,'(a)') '----------'
write(*,'(a)') 'calling foo with associated fixed i section'
associate( A2 => A(2,:) )
call foo(A2)
end associate
write(*,'(a)') '----------'
end program assoc
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64773
[Bug 64773] [F2008] Not packing arrays with changing variable used for size in
block