https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92318
Bug ID: 92318
Summary: Nondeterministic ICE with -mcmodel=large -O2
Product: gcc
Version: 7.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: jellby at yahoo dot com
Target Milestone: ---
Compiling this Fortran code with -mcmodel=large -O2 segfaults intermittently:
subroutine diffeq (nvar,y,x1,x2,eps,h1,gvalue)
implicit none
real*8, parameter :: tiny=1.0d-30
integer i,nvar,nstep,maxstep
real*8 x,x1,x2,h,h1,eps,hnext,hdid,y(*)
real*8, allocatable :: dydx(:),yscal(:)
logical terminate
external gvalue
terminate = .false.
h = sign(h1,x2-x1)
nstep = 0
maxstep = 100
allocate (dydx(nvar))
allocate (yscal(nvar))
do while (.not. terminate)
do i = 1, nvar
yscal(i) = abs(y(i)) + abs(h*dydx(i)) + tiny
end do
call bsstep (nvar,x,dydx,y,h,eps,yscal,hdid,hnext,gvalue)
h = hnext
nstep = nstep + 1
if (nstep .ge. maxstep) then
terminate = .true.
end if
end do
deallocate (dydx)
deallocate (yscal)
end
$ /usr/bin/gfortran -c -mcmodel=large diffeq.f -o diffeq.o -O2
$ /usr/bin/gfortran -c -mcmodel=large diffeq.f -o diffeq.o -O2
diffeq.f:29:0:
end
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
$ /usr/bin/gfortran -c -mcmodel=large diffeq.f -o diffeq.o -O2
$ /usr/bin/gfortran -c -mcmodel=large diffeq.f -o diffeq.o -O2
$ /usr/bin/gfortran --version
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.