[Bug fortran/19015] New: shape / rank mismatch in maxloc / minloc leads to assertion failure at runtime

Thomas dot Koenig at online dot de gcc-bugzilla@gcc.gnu.org
Wed Dec 15 17:14:00 GMT 2004


$ cat maxloc-2.f90
  integer, dimension(0:1,0:1) :: n
  integer, dimension(1) :: i
  n = reshape((/1, 2, 3, 4/), shape(n))
  i = maxloc(n)
  print *,i
end program
$ gfortran maxloc-2.f90
$ ./a.out
a.out: ../../../gcc-4.0-20041212/libgfortran/generated/maxloc0_4_i4.c:49:
__maxloc0_4_i4: Assertion `retarray->dim[0].ubound + 1 - retarray->dim[0].lbound
== rank' failed.
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)

This is actually not too bad, but could be caught at compile-time.

Same for minloc.

-- 
           Summary: shape / rank mismatch in maxloc / minloc leads to
                    assertion failure at runtime
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        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=19015



More information about the Gcc-bugs mailing list