<?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:Allocatable function result should not have allocatable attribute in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1546214#M169324</link>
    <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/157087"&gt;@Harald1&lt;/a&gt; and &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/92920"&gt;@FortranFan&lt;/a&gt;, when you install the compilers that were released this week you will find error messages for the invalid code in both reproducers. &lt;/P&gt;&lt;P&gt;Please check out 2024.0!&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 21 Nov 2023 20:10:45 GMT</pubDate>
    <dc:creator>Barbara_P_Intel</dc:creator>
    <dc:date>2023-11-21T20:10:45Z</dc:date>
    <item>
      <title>Allocatable function result should not have allocatable attribute</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1477200#M166093</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;the following code is accepted by Intel but rejected by NAG:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;program main
  integer, allocatable :: p
  p = f()
  print *, allocated(p)
  print *, is_allocated(p)
  print *, is_allocated(f())    ! Invalid per F2018 8.5.3 Note 1

contains
  function f()
    integer, allocatable :: f
    allocate (f, source=42)
  end function

  logical function is_allocated(p)
    integer, allocatable :: p

    is_allocated = allocated(p)
  end function
end program
&lt;/LI-CODE&gt;
&lt;P&gt;NAG prints:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;NAG Fortran Compiler Release 7.1(Hanzomon) Build 7101
Error: pr109500.f90, line 6: Expected an ALLOCATABLE variable for argument P (no. 1) of IS_ALLOCATED
[NAG Fortran Compiler error termination, 1 error]
&lt;/LI-CODE&gt;
&lt;P&gt;Indeed Fortran 2018, 8.5.1, Note 1 says:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;Only variables and components can have the ALLOCATABLE attribute. The result of referencing a func-
tion whose result variable has the ALLOCATABLE attribute is a value that does not itself have the
ALLOCATABLE attribute.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;At least in standard conformance mode Intel should diagnose this, but ifort silently accepts it, and ifx crashes with:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;pr109500.f90(6): error #5623: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
  print *, is_allocated(f())    ! Invalid per F2018 8.5.3 Note 1
--^
compilation aborted for pr109500.f90 (code 3)
&lt;/LI-CODE&gt;
&lt;P&gt;(traceback elided).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Apr 2023 20:04:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1477200#M166093</guid>
      <dc:creator>Harald1</dc:creator>
      <dc:date>2023-04-16T20:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Allocatable function result should not have allocatable attribute</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1477263#M166094</link>
      <description>&lt;P&gt;Intel team,&lt;/P&gt;
&lt;P&gt;Perhaps you will consider the following variant &lt;STRONG&gt;also&lt;/STRONG&gt; toward the bug incident report.&amp;nbsp; Note the lines marked A, B, and C.&amp;nbsp; A conforming processor shall detect and report noncompliance with each of these 3 cases, but IFORT fails to do so with C.&amp;nbsp; As OP stated, IFX encounters an ICE with C.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;   !call sub( 0 )    !&amp;lt;-- A
   !call sub( f1() ) !&amp;lt;-- B
   call sub( f2() )  !&amp;lt;-- C
contains
   subroutine sub( a )
      integer, allocatable :: a
   end subroutine
   function f1() result(r)
      integer :: r
      r = 42
   end function
   function f2() result(r)
      integer, allocatable :: r
      r = 42
   end function
end 
&lt;/LI-CODE&gt;&lt;LI-CODE lang="none"&gt;C:\temp&amp;gt;ifx /c /free /standard-semantics p.f
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2023.1.0 Build 20230320
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.

 #0 0x00007ff6012d075a (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x30075a)
 #1 0x00007ff6012d072a (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x30072a)
 #2 0x00007ff6011f66d4 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x2266d4)
 #3 0x00007ff6011c9c3a (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x1f9c3a)
 #4 0x00007ff601210d48 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x240d48)
 #5 0x00007ff6012563d8 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x2863d8)
 #6 0x00007ff601256a30 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x286a30)
 #7 0x00007ff601255480 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x285480)
 #8 0x00007ff60124bbfc (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x27bbfc)
 #9 0x00007ff601249de9 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x279de9)
#10 0x00007ff6012491bc (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x2791bc)
#11 0x00007ff60132206f (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x35206f)
#12 0x00007ff60132265c (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x35265c)
#13 0x00007ff601324b66 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x354b66)
#14 0x00007ff60132206f (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x35206f)
#15 0x00007ff60131effd (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x34effd)
#16 0x00007ff60132206f (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x35206f)
#17 0x00007ff60119f90a (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x1cf90a)
#18 0x00007ff60119f34a (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x1cf34a)
#19 0x00007ff60138c31e (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x3bc31e)
#20 0x00007ff6037f6060 (C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\xfortcom.exe+0x2826060)
#21 0x00007ff84f307614 (C:\WINDOWS\System32\KERNEL32.DLL+0x17614)
#22 0x00007ff84f5426a1 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x526a1)

p.f(3): error #5623: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
   call sub( f2() )  !&amp;lt;-- C
---^
compilation aborted for p.f (code 3)

C:\temp&amp;gt;ifort /c /free /standard-semantics p.f
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.9.0 Build 20230302_000000
Copyright (C) 1985-2023 Intel Corporation.  All rights reserved.


C:\temp&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 01:51:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1477263#M166094</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2023-04-17T01:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Allocatable function result should not have allocatable attribute</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1478482#M166136</link>
      <description>&lt;P&gt;The ICE with ifx is melted (gone) for both reproducers in the next release.&lt;/P&gt;
&lt;P&gt;Checking on the missing error message...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 21:17:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1478482#M166136</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-04-19T21:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Allocatable function result should not have allocatable attribute</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1478494#M166138</link>
      <description>&lt;P&gt;Bug filed for the missing error message, CMPLRLLVM-46937, with both reproducers. I'll let you know when it's fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 21:39:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1478494#M166138</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-04-19T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re:Allocatable function result should not have allocatable attribute</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1546214#M169324</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/157087"&gt;@Harald1&lt;/a&gt; and &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/92920"&gt;@FortranFan&lt;/a&gt;, when you install the compilers that were released this week you will find error messages for the invalid code in both reproducers. &lt;/P&gt;&lt;P&gt;Please check out 2024.0!&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Nov 2023 20:10:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1546214#M169324</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-11-21T20:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Allocatable function result should not have allocatable attribute</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1546628#M169364</link>
      <description>&lt;P&gt;Confirmed.&amp;nbsp; I now get appropriate error messages for the testcase.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 21:35:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocatable-function-result-should-not-have-allocatable/m-p/1546628#M169364</guid>
      <dc:creator>Harald1</dc:creator>
      <dc:date>2023-11-22T21:35:22Z</dc:date>
    </item>
  </channel>
</rss>

