Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29642 Discussions

nested derived type with POINTER causes ICE

forall
Beginner
1,541 Views
[cpp]the following code triggered an ICE event in 11.1.038 but was ok in 11.1.035

the problem appears due to pointers in nested derived types.

also attached is the complete solution+project.


============================

! THIS CODE WAS COMPILED AS A STATIC LIBRARY USING DEFAULT PROJECT SETTINGS ! DEBUG MODE DOESN'T TRIGGER ICE ! RELEASE MODE (02 and above) TRIGGERS ICE ! !Compiling with Intel Visual Fortran 11.1.038 [IA-32]... !mcmc_dmsl_kit.f90 !fortcom: Fatal: There has been an internal compiler error (C0000005). !compilation aborted for D:fortranzjunkMCMC_IVF_ICEmcmc_dmsl_kit.f90 (code 1) ! module mcmc_dmsl_kit implicit none !-- type jParsAdapt_type real,pointer::strk(:,:)=>null() ! real::strk(1,1) ! fixed sized ok endtype jParsAdapt_type !-- type mcmcBlockAdapt_type real,pointer::dat(:,:)=>null() type(jParsAdapt_type),pointer::jPars(:)=>null() ! type(jParsAdapt_type)::jPars(1) ! fixed sized ok endtype mcmcBlockAdapt_type !----- contains !---------------------------------------------------- subroutine metropolis_RK(sample0) implicit none real,intent(in)::sample0(:) ! sample0 needs to be dummy arg to trigger ICE ! locals integer::i,ndim type(mcmcBlockAdapt_type),allocatable::BlokAdapt(:) ! allocatable or pointer both trigger ICE !type(mcmcBlockAdapt_type)::BlokAdapt(1) ! fixed sized ok ndim=size(sample0) ! need link to sample0 to trigger ICE !allocate(BlokAdapt(ndim));allocate(BlokAdapt(1)%jPars(1));allocate(BlokAdapt(1)%jPars(1)%strk(1,1)) !allocate(BlokAdapt(1)%dat(1,1)) do i=1,ndim BlokAdapt(i)%jPars(1)%strk(1,1)=sample0(i) ! need link to sample0 to trigger ICE ! BlokAdapt(i)%dat(1,1)=sample0(i) ! single level ok enddo endsubroutine metropolis_RK !---------------------------------------------------- endmodule mcmc_dmsl_kit [/cpp]
0 Kudos
1 Reply
Kevin_D_Intel
Employee
1,541 Views

Thanks for the convenient reproducer. I confirmed the error, notified Development and will keep this post updated when I have more information about a fix.

(Update): The issue involves the optimizer. If you can tolerate the performance loss, the error is avoidable with /O1

(Internal tracking id: DPD200138746)

(Resolution Update on 11/10/2009): This defect is fixed in the Intel Fortran Compiler Professional Edition 11.1 Update 3, (11.1.051 - Windows).
0 Kudos
Reply