I just submitted the following as the above PR:

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)

Reply via email to