- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code below doesn't compile with ifort on Ubuntu 20.04.4 LTS, returning the error message:
10101_13941
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
Compiler details:
$ which ifort
/opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort
$ ifort --version
ifort (IFORT) 2021.5.0 20211109
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The same thing happens on Windows with version 2021.4.0 of the Intel Fortran oneAPI compiler (the classic one).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This version is accepted:
ul = [(ul(i), i = 1,0)]
and gives a size 0 as well. But the explicit allocation is probably a more palatable idiom ;).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page