This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/15335] [gfortran] runtime error "Attempt to allocate a non-positive amount of memory"


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]