$ cat maxloc-3.f90 integer, dimension(3,3) :: n integer, dimension(2) :: i n = reshape((/3, 2, 1, 4, 7, 8, 7, 8, 9/), shape(n)) i = maxloc(n, mask = n<6 ) print '(3I3)',n print '(3L3)',n<6 print *,i if (.not. n(i(1),i(2))<6) call abort end program $ gfortran maxloc-3.f90 $ ./a.out 3 2 1 4 7 8 7 8 9 T T T T F F F F F 3 2 Aborted $ gfortran -v Reading specs from /home/zfkts/lib/gcc/ia64-unknown-linux-gnu/4.0.0/specs Configured with: ../gcc-4.0-20041212/configure --prefix=/home/zfkts --enable-languages=c,c++,f95 : (reconfigured) ../gcc-4.0-20041212/configure --prefix=/home/zfkts --enable-languages=c,c++,f95 --disable-shared Thread model: posix gcc version 4.0.0 20041212 (experimental)
-- Summary: maxloc ignores mask Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Thomas dot Koenig at online dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19016