This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/15335] runtime error "Attempt to allocate a negative amount of memory"
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2006 23:45:54 -0000
- Subject: [Bug fortran/15335] runtime error "Attempt to allocate a negative amount of memory"
- References: <bug-15335-7283@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from pault at gcc dot gnu dot org 2006-03-01 23:45 -------
OK I have written a patch that fixes:
real :: a(1:4) = (/((i-1)**2,i=1,4)/)
real :: b(1)
i=2
b = maxloc(a(1:i-2)+1.)
print *, b
end
For i=3 or greater, gfortran and ifort agree on the value of b. However, for
the above, gfortran now gives 0, whilst ifort gives 1. I happen to think that
0 makes more sense but.... does anybody know the accepted result?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15335