Silverfrost Forums

Welcome to our forums

Internal compiler with /check

13 Mar 2020 1:34 #25089

The following subroutine is compiled without error with /debug or /opt, but causes an ICE with /check, /undef and /checkmate, with Versions 6.35, 7.2 and 8.51 (for the last, also with /64 added).

    subroutine get_sys_mat()
       implicit none

       integer :: i
       type :: sys_ab
          real, allocatable :: a(:)
       end type

       type (sys_ab) :: sys
       complex, allocatable :: a_cplx(:)

       allocate(sys%a(10))
       do i=1,10
          sys%a(i) = cmplx(2.5*i+3.3, -2.3)
       end do
       allocate (a_cplx(10))
       a_cplx = sys%a
       print *,a_cplx
       deallocate (a_cplx,sys%a)

    end subroutine get_sys_mat

This test code was pared down from a ~4,000 line source file with dependencies on a number of additional modules.

13 Mar 2020 4:11 #25090

mecej4

Thank you for this. I have added it to the list.

15 Mar 2020 12:32 (Edited: 19 Mar 2020 11:43) #25094

This variant of the test code may provide information that may help in finding the reason for the bug; this version does not use complex variables at all.

    subroutine get_sys_mat()
       implicit none

       integer :: i
       type :: sys_ab
          integer, allocatable :: a(:)
       end type

       type (sys_ab) :: sys
       real, allocatable :: al(:)

       allocate(sys%a(10))
       do i=1,10
          sys%a(i) = 2.5*i+3.3
       end do
       allocate (al(10))
       al = sys%a
       print *,al
       deallocate (al,sys%a)

    end subroutine get_sys_mat

Compiling with /check displays an ICE.

Furthermore, changing 'real' to 'integer' in the declaration of the local variable 'al' causes the ICE to disappear. In this short test code, there is no reason for 'al' to be of type REAL, but that is not true for the much larger code in my application.

16 Mar 2020 7:01 #25095

mecej4

Many thanks for the extra information.

Paul

19 Mar 2020 8:31 #25098

This failure has now been fixed for the next release of FTN95.

19 Mar 2020 1:19 #25099

Thank you.

Please login to reply.