This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Integer changes mid-execution
- From: Nishita Desai <nish dot des at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 3 Nov 2009 16:58:42 +0530
- Subject: Integer changes mid-execution
Dear All,
I have a very strange problem while running a program compiled using
gfortran. Here is the do-loop in question (Line numbers in brackets):
(237) DO I=1,4
(238) P(I,NPART)=PHEP(I,IHEP)
(239) END DO
What happens is that suddenly at the end of the third iteration,
NPART changes value. Here is a gdb transcript:
--
Breakpoint 8, hwanal (iev=@0x7fffc1bbaf0c) at rpv_herwig.f90:236
236 NPART=NPART+1
(gdb) p npart
$178 = 1019
(gdb) step
237 DO I=1,4
(gdb) p i
$179 = 5
(gdb) p npart
$180 = 1020
(gdb) step
238 P(I,NPART)=PHEP(I,IHEP)
(gdb) p i
$181 = 1
(gdb) p npart
$182 = 1020
(gdb) step
237 DO I=1,4
(gdb) p i
$183 = 1
(gdb) p npart
$184 = 1020
(gdb) step
238 P(I,NPART)=PHEP(I,IHEP)
(gdb) p i
$185 = 2
(gdb) p npart
$186 = 1020
(gdb) step
237 DO I=1,4
(gdb) p i
$187 = 2
(gdb) p npart
$188 = 1020
(gdb) step
238 P(I,NPART)=PHEP(I,IHEP)
(gdb) p i
$189 = 3
(gdb) p npart
$190 = 1020
(gdb) step
237 DO I=1,4
(gdb) p i
$191 = 3
(gdb) p npart
$192 = -1068493575
--
Can anyone tell me what is going wrong? I appreciate any help!
Thanks,
Nishita