This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68226] New: ICE on wrong assignment of function pointer to allocatable
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Nov 2015 20:54:41 +0000
- Subject: [Bug fortran/68226] New: ICE on wrong assignment of function pointer to allocatable
- Auto-submitted: auto-generated
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.fortran@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