The following test code reflects a problem observed in debug regarding functions.
PROBLEM: FUNCTIONs with ENTRY points are crashing under debug
COMPILER FLAGS:
/nologo /Zi /Od /module:"$(INTDIR)/" /object:"$(INTDIR)/" /traceback /libs:static /threads /dbglibs /c
VERSION OF FORTRAN:
Intel 9.1
DEVELOPMENT ENVIRONMENT:
Visual Studio 2005
FREQUENCY: happens every time in debug; never in release. It does not happen if "func" does not have an ENTRY statement in it.
TEST CODE:
!***************************************************************
!
! PROGRAM: TestError
!
! PURPOSE: Test problem with function entries under debug.
!
!***************************************************************
program TestError
real x, func_entry, func
! *** test functions
x=func(1.,2.)
x=func_entry
print*, 'x= ', x
end program TestError
! *********************************
real function func( x, y )
real x, y
func = 0.0
return
entry func_entry
func=1.0
return
end
連結已複製
9 回應
Either func or func_entry can be assigned. The language states that these two are effectively EQUIVALENCEd.
The lack of the parentheses on the "call" to func_entry is the real problem. This changes the statement to an assignment of an uninitialized variable called func_entry instead of a function call.
The lack of the parentheses on the "call" to func_entry is the real problem. This changes the statement to an assignment of an uninitialized variable called func_entry instead of a function call.
I tried both of their suggestions:
x=func_entry()
and
func_entry=1.0
Here is the runtime error under debug:
forrtl: severe (193): Run-Time Check Failure. The variable 'FUNC$FUNC' is being
used without being defined
Image PC Routine Line Source
testerror.exe 00492232 Unknown Unknown Unknown
testerror.exe 0048F4C4 Unknown Unknown Unknown
testerror.exe 00405412 Unknown Unknown Unknown
testerror.exe 0040563A Unknown Unknown Unknown
testerror.exe 00401162 _FUNC 28 TestError.f90
testerror.exe 00401034 _MAIN__ 12 TestError.f90
testerror.exe 00498980 Unknown Unknown Unknown
testerror.exe 0043BBE3 Unknown Unknown Unknown
testerror.exe 0043B9AD Unknown Unknown Unknown
kernel32.dll 7C816D4F Unknown Unknown Unknown
used without being defined
Image PC Routine Line Source
testerror.exe 00492232 Unknown Unknown Unknown
testerror.exe 0048F4C4 Unknown Unknown Unknown
testerror.exe 00405412 Unknown Unknown Unknown
testerror.exe 0040563A Unknown Unknown Unknown
testerror.exe 00401162 _FUNC 28 TestError.f90
testerror.exe 00401034 _MAIN__ 12 TestError.f90
testerror.exe 00498980 Unknown Unknown Unknown
testerror.exe 0043BBE3 Unknown Unknown Unknown
testerror.exe 0043B9AD Unknown Unknown Unknown
kernel32.dll 7C816D4F Unknown Unknown Unknown
Oh, you are using the optional uninitialized variable checking and are getting a run-time error for that. Not quite what I would consider "crashed".
Anyway, I don't see this behavior with the just-released 9.1.025. Please try that.
Anyway, I don't see this behavior with the just-released 9.1.025. Please try that.
Glad to hear it.
Please remember that this is a user forum and not meant as a channel for submitting support requests to Intel. Please use Intel Premier Support for that.
Please remember that this is a user forum and not meant as a channel for submitting support requests to Intel. Please use Intel Premier Support for that.
