- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's true
W11
VS 2022
Compiling with Intel® Fortran Compiler 2025.1.0 [Intel(R) 64]...
ifx /nologo /O3 /module:"x64\Release\\" /object:"x64\Release\\" /libs:dll /threads /c /Qlocation,link,"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64" /Qm64 "B:\FORO20\P.F90"
Linking...
Link /OUT:"x64\Release\FORO20.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Release\FORO20.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /SUBSYSTEM:CONSOLE /IMPLIB:"B:\FORO20\x64\Release\FORO20.lib" -qnextgen -qm64 "x64\Release\P.obj"
Embedding manifest...
mt.exe /nologo /outputresource:"B:\FORO20\x64\Release\FORO20.exe;#1" /manifest "x64\Release\FORO20.exe.intermediate.manifest"
FORO20 - 0 error(s), 0 warning(s)
Program
program test
real(kind=8) :: A(13)
real(kind=8) :: B(13)
integer :: i
open(8,file='table.txt')
DO i=1,13
read (8,*) B(i)
A(i) = B(i)
!WRITE(*,*)A(I),B(I)
ENDDO
DO I=1,13
WRITE(*,*)A(I),B(I)
ENDDO
end program test
Result
0.000000000000000E+000 20.0000000000000
0.000000000000000E+000 40.0000000000000
0.000000000000000E+000 60.0000000000000
0.000000000000000E+000 80.0000000000000
0.000000000000000E+000 100.000000000000
0.000000000000000E+000 120.000000000000
0.000000000000000E+000 140.000000000000
0.000000000000000E+000 160.000000000000
0.000000000000000E+000 180.000000000000
0.000000000000000E+000 200.000000000000
0.000000000000000E+000 220.000000000000
0.000000000000000E+000 240.000000000000
0.000000000000000E+000 260.000000000000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @RagnarVdB
I found the same results as you with ifx compiler from oneapi 2024.0 under linux. The code gives correct results for -O1, but starts failing for -O2 and -O3. I've tried various compiler flags but none of them solves the issue. Maybe an Intel specialist can recommend the appropriate flag. However there is definitely something going wrong here and this can be quite tricky to detect in a large code.
Regards
Marc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem posed by RagnarVdB
Incorrect results using -O2 or -O3 in ifx.
I think it's very important
Why are there no answers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Our support team will respond to this. Meanwhile, please check out the Priority Support option for fast turnaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>It seems that the compiler is simply ignoring the fact that B is being written to in the read operation.
That sounds like a correct diagnosis of a compiler optimization bug.
Jim Dempsey

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