[Bug fortran/38813] ICE with C_LOC(array)

sfilippone at uniroma2 dot it gcc-bugzilla@gcc.gnu.org
Fri Jan 13 12:48:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38813

Salvatore Filippone <sfilippone at uniroma2 dot it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sfilippone at uniroma2 dot
                   |                            |it

--- Comment #6 from Salvatore Filippone <sfilippone at uniroma2 dot it> 2012-01-13 12:44:46 UTC ---
Hello,
Has this ever been resolved? 
I still get an ICE with a code that is essentially that of comment 1, i.e.
getting the C_LOC of an allocatable component; this is true of 4.6.1 and of
current trunk as of today. 
Interestingly, the following compiles (but I have not tried yet if it works at
runtime): 

module foo_mod
  type foo_type
    integer, allocatable :: idx(:)
  end type foo_type
end module foo_mod

subroutine bar2(data)
  use foo_mod
  use iso_c_binding 
  implicit none
  type(foo_type), intent(inout), target :: data 
  type(c_ptr)          :: cptr

  call getcptr(cptr,data%idx)

contains
  subroutine getcptr(cp,v)
    type(c_ptr) :: cp
    integer, allocatable, target  :: v(:)
    cp = c_loc(v)
  end subroutine getcptr
end subroutine bar2


Thanks a lot
Salvatore



More information about the Gcc-bugs mailing list