- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code block below appears to generate bad code when the automatic vectorizer is enabled but correct code when /Qvec- is used even up to /O3 optimization. The vectorizer does not track N properly so that the values of RD for N=5-8 are repeated for N=9-12 followed by the values expected for N=9 and up.
[fortran]N = 0
R = RFI
DO I = 1, M1B
K = M2(I)
DR = DROD*F(I)
DO J = 1, K
R = R + DR
N = N + 1
RD(N) = R
R = R + DR
END DO
END DO[/fortran]
Adding a PRINT statement in the inner loop (which probably disables vectorization) also eliminates the incorrect behavior.
This occurs running Intel(R) Composer XE 2013 Update 5 (package 198). I am downloading SP1 and will try that.
If this is a confirmed bug it would be great to have it reported formally.
Thanks,
Stuart
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is still present with 14.0 in SP1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Complete example, please. Excerpts and paraphrases are not helpful in analysis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, here it is boiled down to a simple program that shows the bug.
[fortran]PROGRAM vectorizer_bug
INTEGER :: J, N
REAL(8) :: DR, R, RD(7)
N = 0
R = 10.0
DR = 2.0
DO J = 1, 7
R = R + DR
N = N + 1
RD(N) = R
R = R + DR
END DO
PRINT *, RD
END PROGRAM[/fortran]
Built with ifort /O3 /Qvec- it outputs this as it should:
12.0000000000000 16.0000000000000 20.0000000000000
24.0000000000000 28.0000000000000 32.0000000000000
36.0000000000000
Built with ifort /O3 it outputs this:
12.0000000000000 16.0000000000000 20.0000000000000
24.0000000000000 28.0000000000000 32.0000000000000
24.0000000000000
where the last value is wrong.
Running: Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.103 Build 20130728
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - I can reproduce the problem and will investigate. I see the same results going back to 12.1, at least.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as issue DPD200248081. Thanks for the nice example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Is there any work around for this? And, this is not just the 14 compiler, correct? The bug goes back farther than that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I can see the problem in 13.1 and 12.1. I did not try other versions. Disabling vectorization is the best workaround. The developers are analyzing the issue now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The developers figured out what is going wrong and are working on a fix. It turns out that we have a couple of other reports with varying symptoms that end up being the same bug. I will let you know of further progress.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This error has made me wary of using AVX in released code so I have turned it off for now. Is a fix coming in the next update ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, it looks as if it was fixed in Update 1, released in October. I missed the notice of the fix. Let me know if you find otherwise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The test code runs correctly when built with 14.0.1.139 Build 20131008 but not with the current 13.1 version, 13.1.3.198 Build 20130607.
Questions:
- Will the fix be back-ported to 13.1 (and earlier) compilers?
- Do you believe that the vectorizer is fixed/safe in general now for the 14.0.1 C++ and Fortran compilers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We don't backport fixes except under extraordinary circumstances, and we have no planned further updates to 13.1.
We believe the vectorizer to be safe to use - and we did before, as our extensive testing did not reveal problems. But there are no guarantees.

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