https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118750
Bug ID: 118750
Summary: [14/15 Regression] ICE on associate with elemental
function with polymorphic array actual argument
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: damian at archaeologic dot codes
Target Milestone: ---
The code below compiles without error with gfortran 12 and 13 but causes
internal compiler errors with gfortran 14.2.0 and 15.
% cat all.f90
implicit none
type string_t
end type
associate(string_array => get_string([string_t::]))
end associate
contains
type(string_t) elemental function get_string(mold)
class(string_t), intent(in) :: mold
get_string = string_t()
end function
end
% gfortran-14 all.f90
all.f90:6:53:
6 | associate(string_array => get_string([string_t::]))
| 1
internal compiler error: Segmentation fault: 11
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/Homebrew/homebrew-core/issues> for instructions.
% gfortran all.f90
all.f90:6:53:
6 | associate(string_array => get_string([string_t::]))
| 1
internal compiler error: in gfc_get_descriptor_field, at
fortran/trans-array.cc:248
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
% gfortran --version
GNU Fortran (GCC) 15.0.1 20250119 (experimental)