Playing with the following test case (see
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/83b587a930639741#
):
program sizetest1
use ISO_C_BINDING
implicit none
type contains_pointer
integer data
type(contains_pointer), pointer :: next
end type contains_pointer
integer, parameter :: ik1 = selected_int_kind(2)
type(contains_pointer) sp
type(contains_pointer), target :: ap(2)
! f90 way:
write(*,'(a,i0)') 'In f90: ', size(transfer(sp,(/1_ik1/)))
! f03 way:
write(*,'(a,i0)') 'In f03: ', &
transfer(C_LOC(ap(2)),1_C_INTPTR_T)- &
transfer(C_LOC(ap(1)),1_C_INTPTR_T)
! f08 way:
write(*,'(a,i0)') 'In f08: ', C_SIZEOF(sp)
end program sizetest1
if I compile without option, the executable gives:
In f90: 16
In f03: 16
In f08: 16
However if I compile with -std=f2003, I get
[macbook] f90/bug% gfc -std=f2003 deriv_size.f90
deriv_size.f90: In function 'sizetest1':
deriv_size.f90:18:0: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:995
...
I get the same error at line 904 with gfortran 4.4.2.
--
Summary: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:995
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dominiq at lps dot ens dot fr
GCC build triplet: x86_64-apple-darwin10
GCC host triplet: x86_64-apple-darwin10
GCC target triplet: x86_64-apple-darwin10
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43539