gfortran internal compiler error
Janus Weil
janus@gcc.gnu.org
Wed Jan 28 18:55:00 GMT 2015
Dear Juan,
> The small program below produces an internal compiler error using gfortran
> in windows (MinGW version: GNU Fortran (GCC) 4.10.0 20140629 (experimental)
> [trunk revision 212119])
sorry, I can not reproduce this. I tried several gfortran releases
(from 4.4 to 4.9) plus the current trunk:
gcc-Version 5.0.0 20150127 (experimental) [trunk revision 220191] (GCC)
... and none of them shows a segfault. Instead they all compile the
code cleanly and even agree on the runtime result:
Sum of all the array elements: 1351698458
So it may either be a MinGW-specific problem or it is due to the fact
that it is a rather old trunk build (which may have regressions that
have been fixed in the meantime). Or are you using any special
compiler flags?
Cheers,
Janus
> Program test_gfortran_segmentation_fault
> implicit none
> integer, dimension(:,:),allocatable :: dat
> real, dimension(:,:),allocatable :: rdat
> integer :: nrow=3000, ncol=7300
> real :: time_factor=0.123456789
> integer(kind=8) :: suma
>
> allocate(dat(nrow,ncol),rdat(nrow,ncol))
> call random_number(rdat)
> rdat=rdat*1000
> dat=nint(rdat)
> dat=nint(real(dat)*time_factor) !<<<<-This statement produces an internal
> compiler error
> !rdat=real(dat)*time_factor !Replacing the above statement with these two
> !dat=nint(rdat) !statemens is OK
> suma=sum(dat)
> write(*,"(a,i12)") " Sum of all the array elements: ",suma
> End Program test_gfortran_segmentation_fault
>
>
More information about the Fortran
mailing list