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

ICE with allocatable scalar substrings

David_Kinniburgh
Beginner
750 Views

[fortran]module keywords implicit none type keyword character(:), allocatable :: c(:) end type keyword type(keyword) :: kw(10) end module keywords !****************************************************** module settings use keywords implicit none contains subroutine save_kw implicit none allocate(character(len=80) :: kw(1)%c(10)) kw(1)%c(1) = 'abcd' if (kw(1)%c(1)(1:1).eq.'a') then ! problem here with substring print *, 'yes' else print *, 'no' endif end subroutine save_kw end module settings !***************************************************** program ice use settings implicit none call save_kw end program ice[/fortran]Is the above valid? In any case, it gives an ICE. The problem is the (1:1) substring reference. It works fine without it and also works if the c() array length is not declared allocatable, iecharacter(80), allocatable:: c(:)array is ok.using w_fcompxe_2011.8.278 : todays update

0 Kudos
4 Replies
Anonymous66
Valued Contributor I
750 Views

The code is valid. Interestingly it only gives an ICE if the substring is the same length as the string it is being compared to. I will escalate this to the developers.

Regards,
Annalee

0 Kudos
Anonymous66
Valued Contributor I
750 Views
The issue number for this problem is DPD200177329.
0 Kudos
Anonymous66
Valued Contributor I
750 Views
We are planning to include a fix for DPD200177329 in a future version which is scheduled to be released later this year.

Regards,
Annalee
0 Kudos
Anonymous66
Valued Contributor I
750 Views
This is issue has been fixed in Intel® Visual Fortran Composer XE for Windows* 2013 which is now available at the Intel® Registration Center. Regards, Annalee Intel Developer Support * Other names and brands may be claimed as the property of others.
0 Kudos
Reply