The code below doesn't compile with ifort on Ubuntu 20.04.4 LTS, returning the error message:
catastrophic error: **Internal compiler error: internal abort** 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.
compilation aborted for ifortbug.f90 (code 1)
module m type :: u real :: x end type end module program test use m type(u), allocatable :: ul(:) ul = [u::] print *, size(ul) end program
$ which ifort
$ ifort --version
ifort (IFORT) 2021.5.0 20211109
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
ICEs are pernicious, hopefully you will find them fixed soon in the compiler.
You will know the workaround you can use is the ALLOCATE statement:
allocate( ul(0) )
By the way, presume you include default initialization for components in your actual codes which is helpful with array objects that can grow/shrink in size:
type :: u real :: x = 0. end type
I tested the original example with our internal builds. There is an update compiler coming out "soon" for ifort and ifx. In this next version ifort still gets an ICE. IFX in the next release aborts gracefully with:
error #5533: Feature found on this line is not yet supported in ifx ul = [u::] --------^
But we've fixed this and the mainline branches compile this example w/o issue and gives the correct result:
$ ifx repro.f90 $ ./a.out 0 $ more repro.f90 module m type :: u real :: x end type end module program test use m type(u), allocatable :: ul(:) ul = [u::] print *, size(ul) end program
There were a number of fixes lately around constructors. Hard to know which one fixed this. But it is coming.