Silverfrost Forums

Welcome to our forums

Error with /DREAL Option

28 Apr 2010 6:47 #6334

Dear colleagues,

I made the experience that errors labelled 'Access Violation' are most difficult to overcome. When such an error occurs in a huge program, it takes normally very long to correct. My first question is therefore whether it would be possible in the future to add some more information.

Such an error happened, when I ran a (huge) problem with the option /DREAL. I have condensed the problem to a few lines, in which I cannot find an error. Access Violation is reported when line 36 is uncommented, whereas no error is reported when it is commented out, althought line 35 and 36 are similar. This error does not occur without the option /DREAL.

Please note that it is not the problem to overcome the error in this (meaningless) program but to ensure that a similar problem does not occur in a much more complicated program environment.

My second question is whether this is a compiler problem with the /DREAL option or a programming error.

Best regards,

Klaus Lassmann

The test consists of the files COMMON Test52.for Run.bat and comp.lis:

      Common /b00/ nwrite
 
      Double Precision     Fpcre3   
 
      Common / FisPro_b /  Fpcre3     ( 2 )
 
!     ==================================================================
!                             Save Statement
      Save
 



      Winapp

      Program Test52

        Include 'Common'

        nwrite    = 10
        Open ( Unit = nwrite, File = 'Test52.out' )

        Fpcre3 (1) = 1.d+00
        Fpcre3 (2) = 2.d+00

        Call Fwrit0_6

      End Program Test52
!     ------------------------------------------------------------------
      Real Function Fgr_rel3 ( i )
 
        Include 'COMMON'
 
        Fgr_rel3 = + Fpcre3 (i)
 
        Return
      End
!     ------------------------------------------------------------------
      Subroutine FWRIT0_6
 
        INCLUDE 'COMMON'
 
        Do i = 1,2
 
          ii = i
 
          write (nwrite, * )   Fgr_rel3  ( ii ) ! OK
          write (nwrite, * ) - Fgr_rel3  ( ii ) ! OK
          write (nwrite, * ) + Fgr_rel3  ( ii ) ! access violation
 
        end do
 
      return
      end




del comp.lis
del *.obj
del *.exe
ftn95 Test52.for    /Dreal /checkmate /Link >> comp.lis
sdbg  Test52.exe



[FTN95/Win32 Ver. 5.50.0 Copyright (c) Silverfrost Ltd 1993-2010]
     Licensed to:  Institut für Transurane, Karlsruhe
     Organisation: Europäische Kommission

    NO ERRORS  [<TEST52> FTN95/Win32 v5.50.0]
    NO ERRORS  [<FGR_REL3> FTN95/Win32 v5.50.0]
    NO ERRORS  [<FWRIT0_6> FTN95/Win32 v5.50.0]
Creating executable: Test52.EXE
28 Apr 2010 8:34 #6336

The best way to diagnose this kind of problem is to load the program into SDBG and click on the run button (you can do this directly within Plato if you wish). This immediately highlights the offending line of code.

Then it may be necessary to break the line up into a few statements in order to find out exactly where the problem is. If you are brave enough, you can look at the assembly code and the registers at the point of failure.

In this particular case there is a problem with FTN95 and I suspect that it may concern the bit size of the real value returned by the function call when DREAL is used. Removing the redundant plus sign avoids the FTN95 bug.

28 Apr 2010 8:45 #6337

Thank you very much Paul for your quick reply.

SDBG helps to find out where the problem is manifested, but this does not always help finding the source of the error. Unfortunately, I am no expert in assembler code or other mysteries but I do hope that my case helps to solve this problem for FTN95.

Klaus

Please login to reply.