http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46974
Summary: ICE with TRANSFER using a C_PTR entity Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: ka...@gcc.gnu.org program bug1 use ISO_C_BINDING implicit none type(c_ptr) :: m type mytype integer a, b, c end type mytype type(mytype) x print *, transfer(32512, x) ! Works. print *, transfer(32512, m) ! Cause ICE. end program bug1 laptop:kargl[206] gfc4x -c po.f90 f951: internal compiler error: Segmentation fault: 11 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. laptop:kargl[207] gdb /usr/home/kargl/work/libexec/gcc/i386-unknown-freebsd9.0/4.6.0/f951 GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-unknown-freebsd8.0"... (gdb) run po.f90 Starting program: /usr/home/kargl/work/libexec/gcc/i386-unknown-freebsd9.0/4.6.0/f951 po.f90 Program received signal SIGSEGV, Segmentation fault. 0x0814d56d in gfc_interpret_derived (buffer=0xbfbfe0e0 "", buffer_size=4, result=0x495759e0) at ../../gcc4x/gcc/fortran/target-memory.c:486 486 ptr = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (cmp->backend_decl)); (gdb) print cmp->backend_decl $1 = (tree) 0x0 (gdb) print *cmp $3 = {name = 0x49830a64 "__c_ptr_c_address", ts = {type = BT_INTEGER, kind = 4, u = {derived = 0x0, cl = 0x0, pad = 0}, interface = 0x0, is_c_interop = 1, is_iso_c = 0, f90_type = BT_INTEGER, deferred = 0 '\0'}, attr = {allocatable = 0, dimension = 0, codimension = 0, external = 0, intrinsic = 0, optional = 0, pointer = 0, target = 0, value = 0, volatile_ = 0, temporary = 0, dummy = 0, result = 0, assign = 0, threadprivate = 0, not_always_present = 0, implied_index = 0, subref_array_pointer = 0, proc_pointer = 0, asynchronous = 0, contiguous = 0, class_pointer = 0, save = SAVE_NONE, data = 0, is_protected = 0, use_assoc = 0, use_only = 0, use_rename = 0, imported = 0, host_assoc = 0, in_namelist = 0, in_common = 0, in_equivalence = 0, function = 0, subroutine = 0, procedure = 0, generic = 0, generic_copy = 0, implicit_type = 0, untyped = 0, is_bind_c = 0, extension = 0, is_class = 0, class_ok = 0, vtab = 0, vtype = 0, is_c_interop = 0, is_iso_c = 0, sequence = 0, elemental = 0, pure = 0, recursive = 0, unmaskable = 0, masked = 0, contained = 0, mod_proc = 0, abstract = 0, noreturn = 0, entry = 0, entry_master = 0, mixed_entry_master = 0, always_explicit = 0, referenced = 0, is_main_program = 0, access = ACCESS_UNKNOWN, intent = INTENT_UNKNOWN, flavor = FL_UNKNOWN, if_source = IFSRC_UNKNOWN, proc = PROC_UNKNOWN, cray_pointer = 0, cray_pointee = 0, alloc_comp = 0, pointer_comp = 0, proc_pointer_comp = 0, private_comp = 0, zero_comp = 0, coarray_comp = 0, select_type_temporary = 0, ext_attr = 0, volatile_ns = 0x0, asynchronous_ns = 0x0}, as = 0x0, backend_decl = 0x0, loc = { nextc = 0x495740e4, lb = 0x49574080}, initializer = 0x0, next = 0x0, formal = 0x0, formal_ns = 0x0, tb = 0x0}