https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107142
Bug ID: 107142
Summary: [PDT] ICE: Segmentation fault (in next_statement)
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
gfortran 13.0.0 20220925 snapshot (g:77bbf69d2981dafc2ef3e59bfbefb645d88bab9d)
ICEs when compiling the following testcase, reduced from
test/Semantics/selecttype01.f90 from the flang 15.0.1 test suite:
module c1162a
type pdt(kind,len)
integer, kind :: kind
integer, len :: len
end type
contains
subroutine foo(x)
class(pdt(kind=1,len=:)), allocatable :: x
select type (x)
type is (pdt(kind=*, len=*))
end select
end subroutine
end module
% gfortran-13.0.0 -c lwe7niqj.f90
lwe7niqj.f90:10:14:
10 | type is (pdt(kind=*, len=*))
| 1
Error: Syntax error in TYPE IS specification at (1)
f951: internal compiler error: Segmentation fault
0xf756bf crash_signal
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/toplev.cc:314
0x928173 next_statement
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/parse.cc:1608
0x92bed0 parse_executable
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/parse.cc:5968
0x92dc90 parse_progunit
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/parse.cc:6238
0x92e094 parse_contained
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/parse.cc:6113
0x92f025 parse_module
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/parse.cc:6486
0x92f468 gfc_parse_file()
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/parse.cc:6793
0x98248f gfc_be_parse_file
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/fortran/f95-lang.cc:229