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

Problems with property "Enable FORTRAN-66 semantics"

nijhuis
Beginner
554 Views

I wonder when the property "Enable FORTRAN-66 semantics" is needed. It is located in the property list of Fortan/Language. I had enabled this property. I really do not know why I enable this property. Probably because I have some old FORTRAN routines in the project. But this property was the origin of a strange effect in my Debug executable (In the Release code the excution is going well): it enables the one-trip loop for all loops in the code, so all loops are executed at least once, even when the iteration count is zero. I don't think this has to do with Fortran-66 semantics. Or am I wrong?

It was not a real problem for me, because I disable the option and all loops are executed following the zero-trip rule. But what happens with programs that really needs this option? They behave different for Debug code and Release code.

0 Kudos
4 Replies
TimP
Honored Contributor III
554 Views
Yes, I would expect the one-trip loop to be the most prominent component of Fortran-66 semantics. Only a minority of f66 compilers handled this close to the f77 manner. If your program depends on this, it isn't f66.
Appendix B of for_lang.pdf mentions also the change in meaning of EXTERNAL from f66 to f77. If your program has a problem there, it would appear as an unsatisfied intrinsic function reference, caused by the use of EXTERNAL where the more recent standards require INTRINSIC.
We continue to require the -WB option to suppress syntax checking against the (non-standard) f66 idiom
dimension x(1). Running afoul of that gives you a clear compile failure, it doesn't produce bugs.
If your program has any other f66-only syntax, I wouldn't have much confidence in "Enable FORTRAN-66 semantics."
0 Kudos
Jugoslav_Dujic
Valued Contributor II
554 Views
You're wrong -- one-trip loops are the essential part of "F66 semantics" (and I don't recall what's there as well) -- zero trip loops required an IF-block around. If the program does not behave like that in Release version, either you forgot to set it for Release version (did you?) or there's a compiler bug. CVF or IVF?
Jugoslav
0 Kudos
Steven_L_Intel1
Employee
554 Views
ifort recognizes the (1) idiom as equivalent to (*) for the purpose of run-time bounds checking; -WB doesn't do anything useful at present.
0 Kudos
nijhuis
Beginner
554 Views
As usual, Jugoslav hits the nail on the head. The flag "Enable Fortran semantics" was not set in the Release version.
I should have remembered my first Fortran-66 steps in the early seventies, when I had to include IF-blocks around the loops to check the iteration count. But, as I stated before, I set the flag by accident. In fact I have a set of Fortran-77 routines, which don't need the flag. Normally,I do some work to translate the code to free format and other Fortran-90/95 feaures, but this package was too large.
Thank you all for the discussion. Now all is working fine.
0 Kudos
Reply