Link Copied
Sorry, the formatting was messed up above. Here is the file again:
module exception_callback
public :: f_err_set_callback
contains
subroutine f_err_set_callback(callback)
external :: callback
end subroutine f_err_set_callback
end module exception_callback
module set_callback
use exception_callback
private
public :: f_err_set_callback
end module set_callback
module main
interface
subroutine init()
use set_callback
end subroutine init
end interface
end module main
end
$ ifort --version
ifort (IFORT) 2021.1.2 20201208
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.
$ ifx --version
ifx (IFORT) 2021.1.2 Beta 20201214
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.
$ ifort bug.f90
bug.f90: 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.
compilation aborted for bug.f90 (code 1)
$ ifx bug.f90
#0 0x00000000019a20c2 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x19a20c2)
#1 0x00000000019a21f0 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x19a21f0)
#2 0x00002b6f2df00400 __restore_rt (/lib64/libc.so.6+0x36400)
#3 0x000000000177e7cb __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x177e7cb)
#4 0x00000000017565bf __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17565bf)
#5 0x00000000018c0dbc __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x18c0dbc)
#6 0x000000000174a9a8 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x174a9a8)
#7 0x0000000001749c39 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1749c39)
#8 0x000000000179bafb __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x179bafb)
#9 0x00000000017a3337 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17a3337)
#10 0x000000000179c0b4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x179c0b4)
#11 0x0000000001796250 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1796250)
#12 0x00000000017ca5c4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17ca5c4)
#13 0x00000000017cb8b4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17cb8b4)
#14 0x000000000198de28 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x198de28)
#15 0x00000000018c5d7c __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x18c5d7c)
#16 0x0000000001a28f18 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1a28f18)
#17 0x00002b6f2deec555 __libc_start_main (/lib64/libc.so.6+0x22555)
#18 0x00000000016e8182 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x16e8182)
bug.f90: 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.
compilation aborted for bug.f90 (code 1)
You probably already know that but ICEs (internal compiler errors) are always serious errors, independent of whether your code is correct or not.
Note that there are at least two ways to workaround the issue:
1.
use the import statement and move the use to module scope like this:
module main
use set_callback
interface
subroutine init()
import set_callback
end subroutine init
end interface
end module main
or using the original module directly instead of the one that wraps it:
module main
interface
subroutine init()
use exception_callback
end subroutine init
end interface
end module main
the second method worked well for BigDFT (viz. https://github.com/ComputeCanada/easybuild-easyconfigs/blob/computecanada-master/easybuild/easyconfi... )
I'll open a bug report. thanks for bringing this to our attention
bug ID CMPLRLLVM-25770
For more complete information about compiler optimizations, see our Optimization Notice.