https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67883
Bug ID: 67883
Summary: ICE on empty array constructor of character function
Product: gcc
Version: 5.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
With an effectively empty (i=m,n and m>n) array constructor :
$ cat z1.f90
program p
integer i
print *, [(f(i), i=2,1)]
contains
function f(n)
integer :: n
character(:), allocatable :: f
character(3) :: c = 'abc'
f = c(n:n)
end
end
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z1.f90
z1.f90:3:25:
print *, [(f(i), i=2,1)]
1
Warning: DO loop at (1) will be executed zero times [-Wzerotrip]
f951: internal compiler error: in gfc_resolve_character_array_constructor, at
fortran/array.c:1955