Silverfrost Forums

Welcome to our forums

Compiler V6.0 crashes on short code with /opt

17 Mar 2011 9:43 #7950

When FTN95 V6.0 is run on the code below with the /opt option, it crashes.

      SUBROUTINE TFBU(N,X,F,G)
      implicit none
      INTEGER N
      REAL X(N),G(N),F
      REAL FA,S1,T,BET
      INTEGER J

      BET=14
      FA=1.73
      DO J=1,N
        IF(J.NE.3) THEN
          T=SQRT(X(J)**2+3.0/J)
          S1=LOG(T)
          G(J)=G(J)+(X(J)*(SIN(S1)**5+COS(S1)**5+
     +         5*SIN(S1)**4*COS(S1)-
     +         5*SIN(S1)*COS(S1)**4)/T)*FA
        ELSE
          G(J)=G(J)+BET*N*FA
        ENDIF
      END DO
      F=0.5D0*F
      RETURN
      END

When the code is slightly modified as given below, the compiler (again with /opt) gives the puzzling message '*** Operand incompatible with opcode':

      SUBROUTINE TFBU28(N,X,F,G)
      implicit none
      INTEGER N
      REAL X(N),G(N),F
      REAL FA,S1,T,BET,ALF
      INTEGER J

      ALF=5
      BET=14
      FA=1.73
      DO J=1,N
        IF(J.NE.3) THEN
          T=SQRT(X(J)**2+3.0/J)
          S1=LOG(T)
          G(J)=G(J)+(X(J)*(SIN(S1)**5+COS(S1)**5+
     +         5*SIN(S1)**(ALF-1.0)*COS(S1)-
     +         5*SIN(S1)*COS(S1)**(ALF-1.0))/T)*FA
        ELSE
          G(J)=G(J)+BET*N*FA
        ENDIF
      END DO
      F=0.5D0*F
      RETURN
      END
17 Mar 2011 10:32 #7954

OK. I will log this for investigation.

17 Mar 2011 11:10 #7955

This rings a bell. I got that puzzling error message once. If I remember correctly, it turned out to be something to do with a slight change in instruction set between two flavours of Pentium CPU, which the compiler was not aware of. So worth trying on a machine of different vintage, if possible.

27 Apr 2011 8:18 #8140

Both of these bugs have now been fixed for the next release.

Please login to reply.