<?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: Potential Bug when using Assumed Rank with Unlimited Polymorphic in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613208#M172899</link>
    <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/116033"&gt;@Lamb__Tripp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Try using the latest Intel opeAPI processor v2024.2, perhaps the issue is fixed already?&lt;/P&gt;&lt;P&gt;Also, a variant you can try is where you use the associate-name facility in the Fortran standard to make it easier for the processor and anyone else reading the code to understand which object is what.&amp;nbsp; See below, perhaps that might help avoid the issue?&lt;/P&gt;&lt;P&gt;Ultimately, you may want to post a reproducer that illustrates the issue with the proper code and the steps you took that led to the problems.&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;   real, target :: x
   class(*), pointer :: x_ptr

   x = 5.6
   x_ptr =&amp;gt; x
   call do_stuff(x_ptr)

contains

   subroutine do_stuff( arg )

       class(*), dimension(..), intent(in) :: arg

       select rank( item =&amp;gt; arg ) !&amp;lt;-- here 'item' effectively becomes an object of specific rank, not one that is an assumed rank
          rank( 0 )
             select type( val =&amp;gt; item ) !&amp;lt;-- here 'val' effectively becomes an object of specific type and kind, not polymorphic
                type is (real)
                   print *, val
             end select
       end select

   end subroutine

end&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 09 Jul 2024 01:39:30 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2024-07-09T01:39:30Z</dc:date>
    <item>
      <title>Potential Bug when using Assumed Rank with Unlimited Polymorphic</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613157#M172898</link>
      <description>&lt;P&gt;There must be something I'm misunderstanding.&lt;/P&gt;&lt;P&gt;I'm attempting to use an assumed rank unlimited polymorphic variable to store data. When I do this I either get access violations or corrupted data. I built a little toy problem to showcase the issue (listed below). The first is an access violation and the second is the corrupted data.&lt;/P&gt;&lt;P&gt;Access Violation&lt;/P&gt;&lt;PRE&gt;   real, target :: x
   class(*), pointer :: x_ptr

   x = 5.6
   x_ptr =&amp;gt; x
   call do_stuff(x_ptr)

contains

   subroutine do_stuff(item)

       class(*), dimension(..), intent(in) :: item

       select rank(item)
       rank(0)
           select type(item) !&amp;lt;--- this is where the debugger crashes
           type is (real)
               print *, item
           end select
       end select

   end subroutine do_stuff&lt;/PRE&gt;&lt;P&gt;Corrupted Data&lt;/P&gt;&lt;PRE&gt;   real, target :: x
   class(*), pointer :: x_ptr

   x = 5.6
   x_ptr =&amp;gt; x
   call do_stuff(x_ptr)

contains

   subroutine do_stuff(item)

       class(*), dimension(..), intent(in) :: item

       select rank(item)
       rank(0)
           call do_stuff_inner(item)
       end select

   end subroutine do_stuff

   subroutine do_stuff_inner(item)

       class(*), intent(in) :: item

       select type(item)
       type is (real)
           print *, item ! prints 4.735692598010119E-312
       end select

   end subroutine do_stuff_inner&lt;/PRE&gt;&lt;P&gt;I appreciate any explanation of what I'm doing wrong. I'm using intel fortran oneapi 2023.0.0.25839. Also to test for posting it does work on this compiler&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.onlinegdb.com/online_fortran_compiler" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.onlinegdb.com/online_fortran_compiler&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 22:52:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613157#M172898</guid>
      <dc:creator>Lamb__Tripp</dc:creator>
      <dc:date>2024-07-08T22:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Potential Bug when using Assumed Rank with Unlimited Polymorphic</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613208#M172899</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/116033"&gt;@Lamb__Tripp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Try using the latest Intel opeAPI processor v2024.2, perhaps the issue is fixed already?&lt;/P&gt;&lt;P&gt;Also, a variant you can try is where you use the associate-name facility in the Fortran standard to make it easier for the processor and anyone else reading the code to understand which object is what.&amp;nbsp; See below, perhaps that might help avoid the issue?&lt;/P&gt;&lt;P&gt;Ultimately, you may want to post a reproducer that illustrates the issue with the proper code and the steps you took that led to the problems.&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;   real, target :: x
   class(*), pointer :: x_ptr

   x = 5.6
   x_ptr =&amp;gt; x
   call do_stuff(x_ptr)

contains

   subroutine do_stuff( arg )

       class(*), dimension(..), intent(in) :: arg

       select rank( item =&amp;gt; arg ) !&amp;lt;-- here 'item' effectively becomes an object of specific rank, not one that is an assumed rank
          rank( 0 )
             select type( val =&amp;gt; item ) !&amp;lt;-- here 'val' effectively becomes an object of specific type and kind, not polymorphic
                type is (real)
                   print *, val
             end select
       end select

   end subroutine

end&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 01:39:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613208#M172899</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2024-07-09T01:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Potential Bug when using Assumed Rank with Unlimited Polymorphic</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613467#M172903</link>
      <description>&lt;P&gt;The associate-name method did not change any behavior. I'll give updating to 2024 a go. It's just a pain as the code is on a computer not connected to the internet, or I would have already tried that.&lt;/P&gt;&lt;P&gt;I'm not sure what a reproducer is, or at least how it differs from what I already posted.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 15:19:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613467#M172903</guid>
      <dc:creator>Lamb__Tripp</dc:creator>
      <dc:date>2024-07-09T15:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Potential Bug when using Assumed Rank with Unlimited Polymorphic</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613484#M172904</link>
      <description>&lt;LI-CODE lang="fortran"&gt;program test
real, target :: x
class(*), pointer :: x_ptr
x = 5.6
x_ptr =&amp;gt; x
call do_stuff(x_ptr)
contains
subroutine do_stuff(item)
    class(*), dimension(..), intent(in) :: item
    select rank(item)
    rank(0)
        select type(item) !&amp;lt;--- this is where the debugger crashes
        type is (real)
            print *, item
        end select
    end select
end subroutine do_stuff
end program test&lt;/LI-CODE&gt;&lt;P&gt;With&amp;nbsp;Intel® Fortran Compiler 2024.2.0 [Intel(R) 64] that program ran OK in debug&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 16:25:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613484#M172904</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2024-07-09T16:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Potential Bug when using Assumed Rank with Unlimited Polymorphic</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613486#M172905</link>
      <description>&lt;LI-CODE lang="fortran"&gt;program test
real, target :: x
class(*), pointer :: x_ptr
x = 5.6
x_ptr =&amp;gt; x
call do_stuff(x_ptr)
call do_stuff2(x_ptr)
print *, 'Finished'
contains
subroutine do_stuff(item)
    class(*), dimension(..), intent(in) :: item
    select rank(item)
    rank(0)
        select type(item) !&amp;lt;--- this is where the debugger crashes
        type is (real)
            print *, item
        end select
    end select
end subroutine do_stuff
subroutine do_stuff2(item)
    class(*), dimension(..), intent(in) :: item
    select rank(item)
    rank(0)
        call do_stuff_inner(item)
    end select
end subroutine do_stuff2
subroutine do_stuff_inner(item)
    class(*), intent(in) :: item
    select type(item)
    type is (real)
        print *, item ! prints 4.735692598010119E-312
    end select
end subroutine do_stuff_inner
end program test&lt;/LI-CODE&gt;&lt;P&gt;And putting both example in 2024.2 that work also with output 5.6, 5.6, Finished. I suggest you update.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 16:32:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Potential-Bug-when-using-Assumed-Rank-with-Unlimited-Polymorphic/m-p/1613486#M172905</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2024-07-09T16:32:38Z</dc:date>
    </item>
  </channel>
</rss>

