<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Thema "Re: Bug with host associated array in contained subroutine with openmp" in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738716#M178410</link>
    <description>&lt;P&gt;On Linux using IFX&amp;nbsp;2025.3.2 20260112, it looks like this bug is fixed:&lt;/P&gt;&lt;LI-CODE lang="none"&gt; 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&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 26 Feb 2026 14:05:32 GMT</pubDate>
    <dc:creator>Mark_Lewy</dc:creator>
    <dc:date>2026-02-26T14:05:32Z</dc:date>
    <item>
      <title>Bug with host associated array in contained subroutine with openmp</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738433#M178391</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;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 program&lt;/LI-CODE&gt;&lt;P&gt;Below is the output when compiled with and without openmp. Sorry it's a bit messy. The important part is that with openmp &lt;STRONG&gt;the values of arr2 are zero inside the subroutine&lt;/STRONG&gt; while they should be equal to -999.9.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt;$ 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               4756928&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Has this bug already been identified and corrected in a later version?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 18:11:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738433#M178391</guid>
      <dc:creator>MarkBuehner</dc:creator>
      <dc:date>2026-02-24T18:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with host associated array in contained subroutine with openmp</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738443#M178392</link>
      <description>&lt;LI-CODE lang="none"&gt;C:\temp&amp;gt;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&amp;gt;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&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Windows + later version seems OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 20:57:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738443#M178392</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2026-02-24T20:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with host associated array in contained subroutine with openmp</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738451#M178396</link>
      <description>&lt;P&gt;Sorry, I didn't mention that I'm using Linux version. Not sure it makes a difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 21:47:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738451#M178396</guid>
      <dc:creator>MarkBuehner</dc:creator>
      <dc:date>2026-02-24T21:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with host associated array in contained subroutine with openmp</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738463#M178398</link>
      <description>I could see you are using Linux, clearly my test changes more than one thing. You really need a Linux test on the latest version. Maybe if at is not an option for you someone else can test.</description>
      <pubDate>Tue, 24 Feb 2026 22:55:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738463#M178398</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2026-02-24T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with host associated array in contained subroutine with openmp</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738716#M178410</link>
      <description>&lt;P&gt;On Linux using IFX&amp;nbsp;2025.3.2 20260112, it looks like this bug is fixed:&lt;/P&gt;&lt;LI-CODE lang="none"&gt; 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&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Feb 2026 14:05:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-host-associated-array-in-contained-subroutine-with/m-p/1738716#M178410</guid>
      <dc:creator>Mark_Lewy</dc:creator>
      <dc:date>2026-02-26T14:05:32Z</dc:date>
    </item>
  </channel>
</rss>

