- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check this out:
module m
implicit none
type :: t(n)
integer, len :: n
real :: x(n)
end type
type, public :: foo
private
real, allocatable :: m_x(:)
type(t(:)), allocatable :: m_t
contains
private
procedure, pass(this), public :: init
end type foo
contains
pure subroutine init(this, x, irc)
!.. Argument list
class(foo), intent(inout) :: this
real, intent(in) :: x(:)
integer, intent(inout) :: irc
!.. Local variables
integer :: size_x
!..
irc = 0
size_x = size(x)
if (size_x > 0) then
allocate( t(size_x) :: this%m_t, stat=irc )
if (irc /= 0) return
this%m_t%x = sqrt(x)
this%m_x = x
else
irc = 1
end if
!..
return
end subroutine init
end module m
program p
use m, only : foo
!..
implicit none
!..
type(foo) :: a
integer :: erc
call a%init( [ 0.0, 0.0 ], erc)
stop
end program p
Upon compilation,
------ Build started: Project: p, Configuration: Debug|x64 ------ Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [Intel(R) 64]... p.f90 101004_2054 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 C:\..\p.f90 (code 1)
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, we'll check it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's worth noting even simpler code with the same pattern experiences ICE:
module m
implicit none
type :: t(n)
integer, len :: n
real :: x(n)
end type
type, public :: foo
private
type(t(:)), allocatable :: m_t
contains
private
procedure, pass(this), public :: init
end type foo
contains
pure subroutine init(this, size_x)
!.. Argument list
class(foo), intent(inout) :: this
integer, intent(in) :: size_x
!.. Local variables
integer :: istat
!..
istat = 0
if (size_x > 0) then
allocate( t(n=size_x) :: this%m_t, stat=istat )
if (istat /= 0) return
end if
!..
return
end subroutine init
end module m
program p
use m, only : foo
!..
implicit none
!..
type(foo) :: a
call a%init( 5 )
stop
end program p
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as issue DPD200366571. It's the call to init that is triggering the ICE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed for a release later this year.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excellent, thanks.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page