<?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 interoperable funciton resul in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761021#M16508</link>
    <description>I expect this to be fixed in a release later this year.</description>
    <pubDate>Thu, 29 Mar 2012 21:02:35 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2012-03-29T21:02:35Z</dc:date>
    <item>
      <title>interoperable funciton resul</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761017#M16504</link>
      <description>&lt;BR /&gt;Dear Participants,&lt;BR /&gt;&lt;BR /&gt;I am not sure where to post bug reports.&lt;BR /&gt;I noticed some people do it here.&lt;BR /&gt;&lt;BR /&gt;I started a comp.lang.fortran thread&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/6297957e666cddc3?hl=en#" target="_blank"&gt;http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/6297957e666cddc3?hl=en#&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and posted a message to comp-fortran-90 about the issues I experienced.&lt;BR /&gt;There is at least one opinion from an active compiler developer&lt;BR /&gt;(on comp-fortran-90) that this might be a compiler bug.&lt;BR /&gt;&lt;BR /&gt;In short, Intel Fortran compiler versions&lt;BR /&gt;&lt;BR /&gt;11.1 Build 20091130&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;12.1.0.233 Build 20110811&lt;BR /&gt;&lt;BR /&gt;segfault when executing the code below.&lt;BR /&gt;Possible reason is insisting on specific compiler calling&lt;BR /&gt;conventions for functions with bind(c) attribute.&lt;BR /&gt;&lt;BR /&gt;Alexei&lt;BR /&gt;&lt;BR /&gt;======= main.f90 =========&lt;BR /&gt;program prog&lt;BR /&gt; use test, only: caller_2&lt;BR /&gt; implicit none&lt;BR /&gt;&lt;BR /&gt; call caller_2()&lt;BR /&gt;end program prog&lt;BR /&gt;&lt;BR /&gt;======== test.f90 =========&lt;BR /&gt;&lt;DIV class="moz-text-plain" wrap="true" lang="x-western"&gt;&lt;PRE&gt;module test

use iso_c_binding
implicit none
private

!
! Short structs  with size matching that  of some integer  type may be
! passed/returned  in  registers. That  depends  on  the platform  ABI
! convention.   BIND(C)  on  the  type(t)  and  relevant  function
! interfaces requests the Fortran compiler to emulate the behaviour of
! (some) C compiler.
!
! &lt;A class="moz-txt-link-freetext" href="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html"&gt;http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html&lt;/A&gt;
!
type, public, bind(c) :: t
   private
   integer(c_intptr_t) :: ptr
end type t

type(t) :: a, b

public :: id
public :: caller_2

contains

  function id(i) result(o) bind(c)
    ! id :: type(t) -&amp;gt; type(t), same as jd().
    implicit none
    type(t), intent(in), value :: i
    type(t) :: o

    o = i
  end function id

  subroutine caller_2()
    implicit none

    b = id(a)
  end subroutine caller_2

end module test
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Feb 2012 12:10:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761017#M16504</guid>
      <dc:creator>amgarching</dc:creator>
      <dc:date>2012-02-21T12:10:18Z</dc:date>
    </item>
    <item>
      <title>interoperable funciton resul</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761018#M16505</link>
      <description>This is a fine place for reporting issues. I can see at least one other thing going wrong here - I will look into it further and let you know.</description>
      <pubDate>Tue, 21 Feb 2012 17:02:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761018#M16505</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-02-21T17:02:17Z</dc:date>
    </item>
    <item>
      <title>interoperable funciton resul</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761019#M16506</link>
      <description>I've identified at least two problems. On Linux IA-32, as you say, the function return value for id is not being put in the register, though the Fortran caller seems to be picking it up from there.&lt;BR /&gt;&lt;BR /&gt;On Windows IA-32, the function id is not picking up the argument from the proper place, but it is returning the value correctly (I think).&lt;BR /&gt;&lt;BR /&gt;Windows x64 seems to be fine. I haven't had the chance to test Linux x64.&lt;BR /&gt;&lt;BR /&gt;Issue ID is DPD200179339. Thanks for bringing this to our attention. I will update this thread with any progress information.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Feb 2012 21:49:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761019#M16506</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-02-23T21:49:51Z</dc:date>
    </item>
    <item>
      <title>interoperable funciton resul</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761020#M16507</link>
      <description>Thanks, x86_64 is where I encountered this problem.</description>
      <pubDate>Tue, 28 Feb 2012 22:40:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761020#M16507</guid>
      <dc:creator>amgarching</dc:creator>
      <dc:date>2012-02-28T22:40:15Z</dc:date>
    </item>
    <item>
      <title>interoperable funciton resul</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761021#M16508</link>
      <description>I expect this to be fixed in a release later this year.</description>
      <pubDate>Thu, 29 Mar 2012 21:02:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/interoperable-funciton-resul/m-p/761021#M16508</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-03-29T21:02:35Z</dc:date>
    </item>
  </channel>
</rss>

