When the mask is all false, F95 leaves it to the processor what to return for maxloc, minloc etc. F2003 specifies 0. We currently use 1, but changing this to 0 would make sense.
$ cat m.f90 program main real, dimension(2) :: a logical, dimension(2) :: fa fa = .false. print *,maxloc(a,fa) end program main $ gfortran m.f90 $ ./a.out 1 -- Summary: [Fortran 2003] maxloc for all-false mask Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: enhancement 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=25378