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

Allocating parametrized declared type that is within a parametrized declared type

AThar2
Beginner
654 Views

I have the following code which gives me a catastrophic error without mentioning what the error is:

catastrophic error: Internal compiler error: segmentation violation signal raised Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

However, I know what triggers this error, namely: allocate(gdad% ttt(tsize=10) :: gdad% test_type)

Anybody familiar with this 

  module t_test
     implicit none

     type ttt(tsize)
        integer, len :: tsize
        real x(tsize)
     end type ttt



  type :: t_rndom_diameter(t_rsize,t_csize)
      integer, len :: t_rsize,t_csize
      real :: x(t_rsize,t_csize)
     type(ttt(tsize=:)), allocatable :: test_type
  end type t_rndom_diameter


  end module t_test


  program p_test
  USE t_test
  implicit none

  type(t_rndom_diameter(t_rsize=3,t_csize=3)) :: gdad

  allocate(gdad% ttt(tsize=10) ::  gdad % test_type)


  end program

 

Thanks in advance

0 Kudos
3 Replies
AThar2
Beginner
654 Views

Just an update, I think I know why now. 

The issue is: allocate(gdad% ttt(tsize=10) :: gdad % test_type), which instead should be 

allocate(ttt(tsize=10) :: gdad % test_type)

0 Kudos
Juergen_R_R
Valued Contributor II
654 Views

An internal compiler error is always an error, so please report this to the Intel support. The ICE seems to be present since at least v17 of the compiler. Nagfor and gfortran both complain that gdad resp. ttt are not derived type members, which indeed they aren't. Indeed your modified code compiles both with ifort and gfortran, and seems to be a correct allocation to me.

0 Kudos
AThar2
Beginner
654 Views

I will file in a report to the support team now. Thanks!

0 Kudos
Reply