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

Optimization "bug" introduced in version 12?

Greynolds__Alan
Beginner
935 Views
Is anyone aware of an optimization bug introduced in version 12? My (very large) application behaves properly when compiled with /O3 under version 11.1but only/O1 or /O0 under 12.x (Isee the sameproblemon the equivalent Mac versions). It also behaves properly when "fully optimized" with other compilers:g95, gfortran, xlf, absoft, and lahey.I know it could still be myfault (i.e. ambiquous code) but I have not been able to isolate the problem since adding debug info or write statements "corrects" the behavior.

Al
0 Kudos
1 Solution
TimP
Honored Contributor III
935 Views
You may get additional information by comparing -opt-report-file results from 11.1 and 12.x compilers, to find differences in the optimizations. I have encountered problems with new OUTER LOOP VECTORIZED, loop run-time versioning, and !dir$ SIMD directives, but actual examples are needed to permit analysis.
If you add code inside a loop which prevents vectorization, you might find that !dir$ no vector directive also would suppress a failure.

View solution in original post

0 Kudos
5 Replies
mecej4
Honored Contributor III
935 Views
> ... adding debug info or write statements "corrects" the behavior.

That is a telltale sign of the presence of a bug in the code or, less commonly, an optimizer bug. Both are hard to prove, isolate and rectify. Considerable effort may be needed to prepare a pared down example that is small enough to be useful to the compiler developers and yet remains able to display the bug.
0 Kudos
TimP
Honored Contributor III
936 Views
You may get additional information by comparing -opt-report-file results from 11.1 and 12.x compilers, to find differences in the optimizations. I have encountered problems with new OUTER LOOP VECTORIZED, loop run-time versioning, and !dir$ SIMD directives, but actual examples are needed to permit analysis.
If you add code inside a loop which prevents vectorization, you might find that !dir$ no vector directive also would suppress a failure.
0 Kudos
Greynolds__Alan
Beginner
935 Views
Actually, I finally was able to isolate the problem to updating a section (k,:,j) of a 3-dimension array and it IS an optimizer bug that occurs in version 12.x with /O2 and not /O1 but not 11.1 even with /O3. Unfortunately I haven't been able to construct a small test case that reproduces it or determine what weird combination of things trigger the effect (I'd hate to believe there is a problem with extracting array sections everywhere!!!).

Al
0 Kudos
Greynolds__Alan
Beginner
935 Views
Thanks Tim ,the !DIR$NOVECTOR directive solved the problem (replacing the array section syntax with an explicit DO also did it).

Al
0 Kudos
Steven_L_Intel1
Employee
935 Views
Please do try to get a test case for us. We'll take a big one if you can't reduce it.
0 Kudos
Reply