- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Participants,
I am not sure where to post bug reports.
I noticed some people do it here.
I started a comp.lang.fortran thread
http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/6297957e666cddc3?hl=en#
and posted a message to comp-fortran-90 about the issues I experienced.
There is at least one opinion from an active compiler developer
(on comp-fortran-90) that this might be a compiler bug.
In short, Intel Fortran compiler versions
11.1 Build 20091130
and
12.1.0.233 Build 20110811
segfault when executing the code below.
Possible reason is insisting on specific compiler calling
conventions for functions with bind(c) attribute.
Alexei
======= main.f90 =========
program prog
use test, only: caller_2
implicit none
call caller_2()
end program prog
======== test.f90 =========
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. ! ! http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html ! 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) -> 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
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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).
Windows x64 seems to be fine. I haven't had the chance to test Linux x64.
Issue ID is DPD200179339. Thanks for bringing this to our attention. I will update this thread with any progress information.
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).
Windows x64 seems to be fine. I haven't had the chance to test Linux x64.
Issue ID is DPD200179339. Thanks for bringing this to our attention. I will update this thread with any progress information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page