<?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 Compiler bug using assumed rank when using pointers? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234727#M153082</link>
    <description>&lt;P&gt;I'm trying to compile the following minimal example which combines assumed rank and pointers using Intel Fortran:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;module mymod
    implicit none

    integer, target :: global_value = 1
    integer, target :: global_array_1d(2) = [1, 2]

contains

    subroutine set_pointer(ptr)
        integer, pointer, intent(out) :: ptr(..)

        select rank (ptr)
            rank (0)
                ptr =&amp;gt; global_value
            rank (1)
                ptr =&amp;gt; global_array_1d
        end select
    end subroutine
end module

program main
    use mymod
    implicit none

    integer, pointer :: value
    integer, pointer :: array_1d(:)

    call set_pointer(value)
    call set_pointer(array_1d)

    write(*,*) 'value: ', value
    write(*,*) 'value: ', array_1d

end program&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intel Fortran version&amp;nbsp;19.1.2.254 gives me the following errors:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;main.f90(14): error #8201: Associate name cannot be a pointer.   [PTR]
                ptr =&amp;gt; global_value
----------------^
main.f90(16): error #8201: Associate name cannot be a pointer.   [PTR]
                ptr =&amp;gt; global_array_1d&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GFortran version 10.2.0 does however compile without any errors.&lt;/P&gt;
&lt;P&gt;I couldn't find anything in the documentation that indicates that this should be illegal, so I'm wondering if it is a compiler bug?&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2020 10:59:13 GMT</pubDate>
    <dc:creator>Paul_Levold</dc:creator>
    <dc:date>2020-12-07T10:59:13Z</dc:date>
    <item>
      <title>Compiler bug using assumed rank when using pointers?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234727#M153082</link>
      <description>&lt;P&gt;I'm trying to compile the following minimal example which combines assumed rank and pointers using Intel Fortran:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;module mymod
    implicit none

    integer, target :: global_value = 1
    integer, target :: global_array_1d(2) = [1, 2]

contains

    subroutine set_pointer(ptr)
        integer, pointer, intent(out) :: ptr(..)

        select rank (ptr)
            rank (0)
                ptr =&amp;gt; global_value
            rank (1)
                ptr =&amp;gt; global_array_1d
        end select
    end subroutine
end module

program main
    use mymod
    implicit none

    integer, pointer :: value
    integer, pointer :: array_1d(:)

    call set_pointer(value)
    call set_pointer(array_1d)

    write(*,*) 'value: ', value
    write(*,*) 'value: ', array_1d

end program&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intel Fortran version&amp;nbsp;19.1.2.254 gives me the following errors:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;main.f90(14): error #8201: Associate name cannot be a pointer.   [PTR]
                ptr =&amp;gt; global_value
----------------^
main.f90(16): error #8201: Associate name cannot be a pointer.   [PTR]
                ptr =&amp;gt; global_array_1d&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GFortran version 10.2.0 does however compile without any errors.&lt;/P&gt;
&lt;P&gt;I couldn't find anything in the documentation that indicates that this should be illegal, so I'm wondering if it is a compiler bug?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 10:59:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234727#M153082</guid>
      <dc:creator>Paul_Levold</dc:creator>
      <dc:date>2020-12-07T10:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug using assumed rank when using pointers?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234776#M153084</link>
      <description>&lt;P&gt;Yes, it is a bug. Please report it.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;"The associating entity has the ALLOCATABLE, POINTER, or TARGET attribute if the selector has that&lt;BR /&gt;attribute. The other attributes of the associating entity are described in 11.1.3.3."&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 14:26:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234776#M153084</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2020-12-07T14:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug using assumed rank when using pointers?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234780#M153086</link>
      <description>&lt;LI-CODE lang="markup"&gt;@Paul_Levold wrote:

.. I'm wondering if it is a compiler bug?&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/96111"&gt;@Paul_Levold&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;For whatever it's worth, I think it's a compiler bug also.&amp;nbsp; And if you're able to, I suggest you submit a support request at Intel OSC:&amp;nbsp;&lt;A href="https://supporttickets.intel.com/servicecenter?lang=en-US" target="_blank"&gt;https://supporttickets.intel.com/servicecenter?lang=en-US&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The 2 pointer assignments that are flagged as disallowed by the Intel compiler look conforming to me per the Fortran standard that states in section&amp;nbsp;11.1.10.3 Attributes of a SELECT RANK associate name and&amp;nbsp; p3, "The associating entity has the ALLOCATABLE, POINTER, or TARGET attribute if the selector has that&amp;nbsp;attribute."&lt;/P&gt;
&lt;P&gt;My hunch is some confusion may have inadvertently came about with the compiler developer(s) on account of how the standard collects the attributes of an associating entities in one section (11.1.3.3) where the entity is marked as NOT having the POINTER (and ALLOCATABLE, etc.) attributes of the selector e.g., in a SELECT TYPE construct.&amp;nbsp; But SELECT RANK is an exception to this as indicated in its own section.&lt;/P&gt;
&lt;P&gt;Such a disjointed specification of aspects in a published standard on paper-only but little to no accompanying examples verified by "mental" compilers of standard writers are always likely to lead to errors in compiler implementations and I won't be surprised if that's what has led to the bug here.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 14:37:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1234780#M153086</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2020-12-07T14:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug using assumed rank when using pointers?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1235077#M153103</link>
      <description>&lt;P&gt;Thanks guys, and thanks for the link to report the bug, FortranFan. I tend to get a bit lost on the Intel webpages and I'm never quite sure where to report these things... &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 07:15:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-using-assumed-rank-when-using-pointers/m-p/1235077#M153103</guid>
      <dc:creator>Paul_Levold</dc:creator>
      <dc:date>2020-12-08T07:15:09Z</dc:date>
    </item>
  </channel>
</rss>

