https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68226
Bug ID: 68226 Summary: ICE on wrong assignment of function pointer to allocatable Product: gcc Version: 5.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gerhard.steinmetz.fort...@t-online.de Target Milestone: --- This wrong code : $ cat z1.f90 program p type t integer :: n end type type(t), allocatable :: a(:) a = f() contains function f() result(r) class(t), pointer :: r(:) type(t), target :: b(2) = [t(1), t(2)] r => b end end $ gfortran -g -O0 -Wall -fcheck=all z1.f90 z1.f90:6:7: a = f() 1 Warning: POINTER-valued function appears on right-hand side of assignment at (1) [-Wsurprising] z1.f90:6:0: a = f() 1 internal compiler error: in gfc_trans_arrayfunc_assign, at fortran/trans-expr.c:8315