<?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>topic IFX error with complex array in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735226#M178165</link>
    <description>&lt;P&gt;This simple program gives a wrong result if compiled with ifx (version 2025.3, but also with previous versions):&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;program cx
  implicit none
  complex, allocatable, dimension(:,:) :: a
  integer :: i,n

  n=2
  allocate (a(-1:1,n))
  
  a(0,:)=Cmplx(0,1)
  a(-1,:)=Cmplx(4,5)
  a(1,:)=Cmplx(2,3)

  do i=1,n
    write(*,*)i,a(0,i)
  end do
end program cx&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;$ ./cx
           1 (4.000000,5.000000)
           2 (4.000000,5.000000)&lt;/LI-CODE&gt;&lt;P&gt;instead of the expected result (0,1), obtained with ifort and gfortran.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jan 2026 11:41:32 GMT</pubDate>
    <dc:creator>g_granucci</dc:creator>
    <dc:date>2026-01-29T11:41:32Z</dc:date>
    <item>
      <title>IFX error with complex array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735226#M178165</link>
      <description>&lt;P&gt;This simple program gives a wrong result if compiled with ifx (version 2025.3, but also with previous versions):&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;program cx
  implicit none
  complex, allocatable, dimension(:,:) :: a
  integer :: i,n

  n=2
  allocate (a(-1:1,n))
  
  a(0,:)=Cmplx(0,1)
  a(-1,:)=Cmplx(4,5)
  a(1,:)=Cmplx(2,3)

  do i=1,n
    write(*,*)i,a(0,i)
  end do
end program cx&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;$ ./cx
           1 (4.000000,5.000000)
           2 (4.000000,5.000000)&lt;/LI-CODE&gt;&lt;P&gt;instead of the expected result (0,1), obtained with ifort and gfortran.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 11:41:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735226#M178165</guid>
      <dc:creator>g_granucci</dc:creator>
      <dc:date>2026-01-29T11:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: IFX error with complex array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735232#M178167</link>
      <description>&lt;P&gt;Running the code in debug mode leads to correct results. The problem occurs in release mode, probably due to the code optimization...&lt;/P&gt;&lt;P&gt;I'm using version 2025.3.0&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 12:45:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735232#M178167</guid>
      <dc:creator>MarcGrodent</dc:creator>
      <dc:date>2026-01-29T12:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: IFX error with complex array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735267#M178172</link>
      <description>&lt;P&gt;Good catch!&amp;nbsp; As&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/412555"&gt;@MarcGrodent&lt;/a&gt;&amp;nbsp;noted it is optimization related: the bug shows up at /O2 and /O3 but not /O1.&lt;/P&gt;&lt;P&gt;Dumping the whole array shows that a(0,:) is treated as a(-1,:), both in the assignment and the elementwise write: the contents of a(0,:) when printing the whole array can contain (0,0) or uninitialized garbage values.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 17:35:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735267#M178172</guid>
      <dc:creator>Mentzer__Stuart</dc:creator>
      <dc:date>2026-01-29T17:35:06Z</dc:date>
    </item>
    <item>
      <title>Re:IFX error with complex array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735725#M178202</link>
      <description>&lt;P&gt;This loop optimizer bug is still in the latest compiler builds. I have escalated it to be fixed.&lt;/P&gt;&lt;P&gt;LLVM bisect tool points to the hir-post-vec-complete-unroll optimization pass, causing the problem. Note that with O1 results are correct. Looks like a full unrolling has a bug.  I also tried to disable it, but then values are set to zero, which is also not correct.&lt;/P&gt;&lt;P&gt;$ ifx -O2 -fno-unroll-loops test.f90&lt;/P&gt;&lt;P&gt;$ ./a.out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 (0.0000000E+00,0.0000000E+00)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2 (0.0000000E+00,0.0000000E+00)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Feb 2026 22:10:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-error-with-complex-array/m-p/1735725#M178202</guid>
      <dc:creator>Igor_V_Intel</dc:creator>
      <dc:date>2026-02-03T22:10:19Z</dc:date>
    </item>
  </channel>
</rss>

