Showing results for 
Search instead for 
Did you mean: 

Allocating parametrized declared type that is within a parametrized declared type

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

Just an update, I think I

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
Valued Contributor I

An internal compiler error is

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

I will file in a report to

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

0 Kudos