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

FUNCTIONs with ENTRY points are crashing under debug

mattintelnetfort
Beginner
1,185 Views
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 Kudos
9 Replies
Steven_L_Intel1
Employee
1,185 Views
I think you want:

x=func_entry()

instead.
0 Kudos
rase
New Contributor I
1,185 Views
I think the code in the ENTRY should be
entry func_entry
func_entry=1.0
return
Greetings, Wolf
0 Kudos
Steven_L_Intel1
Employee
1,185 Views
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.
0 Kudos
mattintelnetfort
Beginner
1,185 Views
Even with the parenthesis, we get the crash (debug only) given the compiler options specified. Does this run for other folks?
0 Kudos
Steven_L_Intel1
Employee
1,185 Views
Runs fine for me in the debugger and gives the correct answer. What sort of "crash" do you get?
0 Kudos
mattintelnetfort
Beginner
1,185 Views
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
0 Kudos
Steven_L_Intel1
Employee
1,185 Views
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.
0 Kudos
mattintelnetfort
Beginner
1,185 Views
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

0 Kudos
Steven_L_Intel1
Employee
1,185 Views
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.
0 Kudos
Reply