<?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 Re:Runtime ifx/ifort compiler bug in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1585198#M171488</link>
    <description>&lt;P&gt;I just confirmed that the runtime error you reported is indeed fixed in ifx 2024.1.0. That version was released last week. Give it a try!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Apr 2024 16:04:52 GMT</pubDate>
    <dc:creator>Barbara_P_Intel</dc:creator>
    <dc:date>2024-04-01T16:04:52Z</dc:date>
    <item>
      <title>Runtime ifx/ifort compiler bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1550848#M169776</link>
      <description>&lt;P&gt;The following example produces what I believe is a spurious runtime error.&amp;nbsp; It runs correctly using gfortran.&amp;nbsp; The example involves defined assignment of polymorphic variables and assignment of unlimited polymorphic components.&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;module foo_class

  type, abstract :: foo
  contains
    procedure, private :: foo_copy
    generic :: assignment(=) =&amp;gt; foo_copy
    procedure(foo_copy), deferred :: foo_copy_
  end type

  type, extends(foo) :: foo_bar
    class(*), allocatable :: value
  contains
    procedure :: foo_copy_ =&amp;gt; foo_bar_copy
  end type

contains

  subroutine foo_copy(lhs, rhs)
    class(foo), intent(inout) :: lhs
    class(foo), intent(in) :: rhs
    if (same_type_as(lhs, rhs)) then
      call lhs%foo_copy_(rhs)
    else
      error stop
    end if
  end subroutine

  subroutine foo_bar_copy(lhs, rhs)
    class(foo_bar), intent(inout) :: lhs
    class(foo), intent(in) :: rhs
    select type (rhs)
    type is (foo_bar)
      print *, 'before foo_bar assignment'
      lhs%value = rhs%value ! RUNTIME ERROR HERE
      print *, 'after foo_bar assignment'
    end select
  end subroutine

end module

use foo_class
class(foo), allocatable :: src, dest

!! Define SRC
allocate(foo_bar::src)
select type (src)
type is (foo_bar)
  allocate(src%value, source=1)
end select

!! Copy SRC to DEST
allocate(dest, mold=src)
print *, 'before foo assignment'
dest = src
print *, 'after foo assignment'

end&lt;/LI-CODE&gt;&lt;P&gt;The expected results are:&lt;/P&gt;&lt;LI-CODE lang="none"&gt; before foo assignment
 before foo_bar assignment
 after foo_bar assignment
 after foo assignment&lt;/LI-CODE&gt;&lt;P&gt;With ifx I get:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;$ ifx -traceback intel-20231205.f90 
$ ./a.out
 before foo assignment
 before foo_bar assignment
forrtl: severe (122): invalid attempt to assign into a pointer that is not associated
Image              PC                Routine            Line        Source             
a.out              0000000000408E7F  Unknown               Unknown  Unknown
a.out              0000000000405327  foo_bar_copy               34  foo.f90
a.out              0000000000405679  _unnamed_main$$            54  foo.f90
a.out              000000000040519D  Unknown               Unknown  Unknown
libc.so.6          00007F2DA5D6A550  Unknown               Unknown  Unknown
libc.so.6          00007F2DA5D6A609  __libc_start_main     Unknown  Unknown
a.out              00000000004050B5  Unknown               Unknown  Unknown&lt;/LI-CODE&gt;&lt;P&gt;The error message involves a pointer but there is not a pointer anywhere in this example.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:09:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1550848#M169776</guid>
      <dc:creator>NCarlson</dc:creator>
      <dc:date>2023-12-05T20:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime ifx/ifort compiler bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1551282#M169798</link>
      <description>&lt;P&gt;I agree. It's a compiler bug.&lt;/P&gt;
&lt;P&gt;The good news is that it is fixed in the next minor release of ifx and ifort. It's planned to be released near the end of Q1 2024.&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;ifx -what -traceback nc.f90
 Intel(R) Fortran 24.0-1444
a.out
 before foo assignment
 before foo_bar assignment
 after foo_bar assignment
 after foo assignment

rm a.out
ifort -what -traceback nc.f90
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
 Intel(R) Fortran 2021.12.0-1425
a.out
 before foo assignment
 before foo_bar assignment
 after foo_bar assignment
 after foo assignment
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 22:50:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1551282#M169798</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-12-06T22:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime ifx/ifort compiler bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1551297#M169801</link>
      <description>&lt;P&gt;That's great to hear.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 00:18:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1551297#M169801</guid>
      <dc:creator>NCarlson</dc:creator>
      <dc:date>2023-12-07T00:18:07Z</dc:date>
    </item>
    <item>
      <title>Re:Runtime ifx/ifort compiler bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1585198#M171488</link>
      <description>&lt;P&gt;I just confirmed that the runtime error you reported is indeed fixed in ifx 2024.1.0. That version was released last week. Give it a try!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Apr 2024 16:04:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-ifx-ifort-compiler-bug/m-p/1585198#M171488</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-01T16:04:52Z</dc:date>
    </item>
  </channel>
</rss>

