- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
First time post here... we seem to have encountered a problem when switching to a newer version of the compiler (ifx (IFX) 2025.1.0 20250317). Now array variables declared in the main program are not correctly seen in contained subroutines. But this only occurs when compiling with openmp. There is no problem for scalar variables. Here is a simple example:
program test
implicit none
save
real(4), save :: arr1(2)
real(4) :: arr2(2)
real(4) :: scalar
! Initialize to something obvious
arr1 = -999.9
arr2 = -999.9
scalar = -123.4
print *, "Before :", scalar, arr1, arr2, loc(arr1), loc(arr2)
call foo1()
print *, "After :", scalar, arr1, arr2, loc(arr1), loc(arr2)
contains
subroutine foo1()
implicit none
print *, "Inside 1:", scalar, arr1, arr2, loc(arr1), loc(arr2)
end subroutine foo1
end programBelow is the output when compiled with and without openmp. Sorry it's a bit messy. The important part is that with openmp the values of arr2 are zero inside the subroutine while they should be equal to -999.9.
By adding the "save" attribute with arr1 variable it seems we can trick the compiler into doing things correctly and it does equal -999.9 inside the subroutine.
The "loc()" function shows very different addresses for arr1 and arr2 in the body of the program whereas inside the subroutine loc(arr1) is the same as in the program, but loc(arr2) is completely different than in the program.
$ ifx -O2 -fiopenmp test.f90
$ ./a.out
Before : -123.4000 -999.9000 -999.9000 -999.9000 -999.9000 4756992 140732410846224
Inside 1: -123.4000 -999.9000 -999.9000 0.0000000E+00
0.0000000E+00 4756992 4757024
After : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756992 140732410846224
$ ifx -O2 test.f90
$ ./a.out
Before : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 4756928
Inside 1: -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 4756928
After : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 4756928Has this bug already been identified and corrected in a later version?
Thanks,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Linux using IFX 2025.3.2 20260112, it looks like this bug is fixed:
Before : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 140731586795424
Inside 1: -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 140731586795424
After : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 140731586795424
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
C:\temp>ifx /O2 /Qiopenmp testomp.f90
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.3.0 Build 20251010
Copyright (C) 1985-2025 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.44.35214.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:testomp.exe
-subsystem:console
-defaultlib:libiomp5md.lib
-nodefaultlib:vcomp.lib
-nodefaultlib:vcompd.lib
testomp.obj
C:\temp>testomp
Before : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 140700539849984 303005957592
Inside 1: -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 140700539849984 303005957592
After : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 140700539849984 303005957592
C:\temp>Windows + later version seems OK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I didn't mention that I'm using Linux version. Not sure it makes a difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Linux using IFX 2025.3.2 20260112, it looks like this bug is fixed:
Before : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 140731586795424
Inside 1: -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 140731586795424
After : -123.4000 -999.9000 -999.9000 -999.9000
-999.9000 4756960 140731586795424
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page