$ cat pack.f90 program main real, dimension(2,2) :: a a = 0 print *,pack(a,logical(a>0,kind=1)) end program main $ gfortran pack.f90 && ./a.out Fortran runtime error: Funny sized logical array $ cat unpack.f90 program main logical(kind=1),dimension(2,2) :: mask mask = .true. print *,unpack((/1,2,3,4/),mask,0) end program main $ gfortran unpack.f90 && ./a.out Fortran runtime error: Funny sized logical array
-- Summary: pack/unpack with kind=1 or kind=2 mask Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32731