This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/15335] [gfortran] runtime error "Attempt to allocate a non-positive amount of memory"
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 May 2004 03:55:14 -0000
- Subject: [Bug fortran/15335] [gfortran] runtime error "Attempt to allocate a non-positive amount of memory"
- References: <20040507002755.15335.Tobias.Schlueter@physik.uni-muenchen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-07 03:55 -------
I get the following warnings with -O1 -W -Wall:
pr15335.f90: In function `reduce':
pr15335.f90:15: warning: unused parameter `col'
pr15335.f90:15: warning: unused parameter `a'
pr15335.f90:15: warning: unused parameter `row'
pr15335.f90: In function `factor':
pr15335.f90:4: warning: unused variable `a'
pr15335.f90:4: warning: unused variable `b'
pr15335.f90: In function `MAIN__':
pr15335.f90:13: warning: unused variable `a'
pr15335.f90: In function `factor':
pr15335.f90:10: warning: 'i' is used uninitialized in this function
pr15335.f90: In function `reduce':
pr15335.f90:19: warning: unused parameter 'a'
pr15335.f90:19: warning: unused parameter 'row'
pr15335.f90:19: warning: unused parameter 'col'
So I do not know if the use of the uninitialized variable causing the problem, no it is not, I
initialized it to 1 and still got the error.
But I see that P(1: M - 1) is P(1: 0) when M is 1 (which is the first time through the loop) so
it is trying to allocating a size of 0 which causes the error.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15335