- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Converting a CVF project I am finding expressions like:
(I.EQ.0 .OR. ARRAY(I).NE.J)
Which now errors (at least in debug build) when I = 0 (it used to work with CVF either because evaluation ceased after the first clause, or because it didn't detect the array boundary condition)
I appreciate the code is badly written and needs changing, but as it is a runtime problem it's hard to tell if all the instances have been found. I don't suppose there's any compile switch to force evaluation order? Any other suggestions to check they have all been found?
(I.EQ.0 .OR. ARRAY(I).NE.J)
Which now errors (at least in debug build) when I = 0 (it used to work with CVF either because evaluation ceased after the first clause, or because it didn't detect the array boundary condition)
I appreciate the code is badly written and needs changing, but as it is a runtime problem it's hard to tell if all the instances have been found. I don't suppose there's any compile switch to force evaluation order? Any other suggestions to check they have all been found?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at the thread in this forum at http://software.intel.com/en-us/forums/showthread.php?t=70058&o=a&s=lr. There are several interesting contributions to the topic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not discussed prominently in that reference, although mentioned several times on this forum, that CVF did not always follow a left-to-right evaluation when the standard permits it. f2c did so, provided that a strict standard C compiler was in use, and so did HPUX Fortran. Those have been superseded as common models.
I sympathize with the idea that the writers of CVF were next to God, and whatever works there should continue working, but unfortunately, non-standard assumptions are likely to break sooner rather than later.
I sympathize with the idea that the writers of CVF were next to God, and whatever works there should continue working, but unfortunately, non-standard assumptions are likely to break sooner rather than later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks guys, so be it. Apols I clearly didn't research previous posts well enough!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As one of those CVF developers, I find it amusing when people insist that CVF did left-to-right evaluation with short-circuiting, as it certainly did not, witness the many complaints we got with CVF about that. I wrote a "Doctor Fortran" item in 1999 about it...
The standard allows a compiler to evaluate any logically equivalent expression, in any order, to any degree of completeness it chooses. In CVF and IVF, this is largely up to the optimizer and the results can vary depending on the program.
The standard allows a compiler to evaluate any logically equivalent expression, in any order, to any degree of completeness it chooses. In CVF and IVF, this is largely up to the optimizer and the results can vary depending on the program.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page