$ cat mgrid.f
      SUBROUTINE RESID(U,V,R,N,A)
      INTEGER N
      REAL*8 U(N,N,N),V(N,N,N),R(N,N,N),A(0:3)
      INTEGER I3, I2, I1
      DO 600 I3=2,N-1
      DO 600 I2=2,N-1
      DO 600 I1=2,N-1
 600  R(I1,I2,I3)=V(I1,I2,I3)
     >      -A(0)*( U(I1,  I2,  I3  ) )
     >      -A(1)*( U(I1-1,I2,  I3  ) + U(I1+1,I2,  I3  )
     >                 +  U(I1,  I2-1,I3  ) + U(I1,  I2+1,I3  )
     >                 +  U(I1,  I2,  I3-1) + U(I1,  I2,  I3+1) )
     >      -A(2)*( U(I1-1,I2-1,I3  ) + U(I1+1,I2-1,I3  )
     >                 +  U(I1-1,I2+1,I3  ) + U(I1+1,I2+1,I3  )
     >                 +  U(I1,  I2-1,I3-1) + U(I1,  I2+1,I3-1)
     >                 +  U(I1,  I2-1,I3+1) + U(I1,  I2+1,I3+1)
     >                 +  U(I1-1,I2,  I3-1) + U(I1-1,I2,  I3+1)
     >                 +  U(I1+1,I2,  I3-1) + U(I1+1,I2,  I3+1) )
     >      -A(3)*( U(I1-1,I2-1,I3-1) + U(I1+1,I2-1,I3-1)
     >                 +  U(I1-1,I2+1,I3-1) + U(I1+1,I2+1,I3-1)
     >                 +  U(I1-1,I2-1,I3+1) + U(I1+1,I2-1,I3+1)
     >                 +  U(I1-1,I2+1,I3+1) + U(I1+1,I2+1,I3+1) )
      RETURN
      END
$ gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure --prefix=/home/jye2/rrs/138207/usr
--enable-languages=c,c++,fortran --disable-bootstrap
Thread model: posix
gcc version 4.4.0 20080728 (experimental) [trunk revision 138207] (GCC) 
$ gfortran   -O3 -ffast-math     mgrid.f     -c
mgrid.f: In function 'resid':
mgrid.f:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure --prefix=/home/jye2/rrs/138206/usr
--enable-languages=c,c++,fortran --disable-bootstrap
Thread model: posix
gcc version 4.4.0 20080728 (experimental) [trunk revision 138206] (GCC) 
$ gfortran   -O3 -ffast-math     mgrid.f     -c
$


-- 
           Summary: Trunk 138207 miscompiles 172.mgrid on x86-64
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Joey dot ye at intel dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36983

Reply via email to