https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117077
Bug ID: 117077
Summary: ICE due to allocatable component in hidden type
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: ivan.pribec at gmail dot com
Target Milestone: ---
The following program results in an ICE with gfortran 14.2:
module hidden
implicit none
public :: foo
contains
type(foo_type) function foo() result(f)
type :: foo_type
integer :: first
real(kind(1.0d0)) :: second
real, allocatable :: third(:) ! ICE here.
end type
f = foo_type(42, 5.0d0)
end function
end module
program main
use hidden
associate(f => foo())
print *, f%first
print *, f%second
print *, allocated(f%third)
end associate
end program
The ICE disappears if the allocatable array component is removed. A pointer
array also works.