Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 討論

FUNCTIONs with ENTRY points are crashing under debug

mattintelnetfort
初學者
1,203 檢視
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

0 積分
9 回應
Steven_L_Intel1
1,203 檢視
I think you want:

x=func_entry()

instead.
rase
新貢獻者 I
1,203 檢視
I think the code in the ENTRY should be
entry func_entry
func_entry=1.0
return
Greetings, Wolf
Steven_L_Intel1
1,203 檢視
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.
mattintelnetfort
初學者
1,203 檢視
Even with the parenthesis, we get the crash (debug only) given the compiler options specified. Does this run for other folks?
Steven_L_Intel1
1,203 檢視
Runs fine for me in the debugger and gives the correct answer. What sort of "crash" do you get?
mattintelnetfort
初學者
1,203 檢視
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
Steven_L_Intel1
1,203 檢視
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.
mattintelnetfort
初學者
1,203 檢視
Yes, the update to the latest compiler (9.1.025) did the trick and got rid of our runtime error. Thanks!

Message Edited by MattIntelNETFort on 06-06-200611:08 AM

Steven_L_Intel1
1,203 檢視
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.
回覆