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

global optimizations

jvandeven
New Contributor I
709 Views

I have found that, after replacing a section of source code, selecting the /Og or /O3 compiler options now result in incorrect program output. I obtain correct results when global optimisations are disabled, and have crawled over my code in the debugger, but cannot find an error. My efforts to find the source of the problem is complicated by the fact that I obtain the message: "cannot view register variable" for a large number of variables in the watch window when global optimisations are enabled. Any tips to aid my debugging would be greatly appreciated!

Justin.

0 Kudos
2 Replies
Ilie__Daniel
Beginner
709 Views

Justin,

What version of the compiler are you using?

What are the compilation flags you use? (you can find this from the build log)

Daniel.

0 Kudos
TimP
Honored Contributor III
709 Views

You should find quite a few hints, if you would search this forum and other useful places. Debug sets /Od by default, as that is necessary in order to avoid register variables.

Un-initialized and mis-declared variables, subscript range violation, failure to use /fp:precise where needed, all are likely causes of incorrect results with optimization. /check options may be helpful.

0 Kudos
Reply