https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103508
Bug ID: 103508
Summary: ICE in gfc_find_symtree, at fortran/symbol.c:2979
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Affects versions down to at least r5 :
$ cat z1.f90
program p
type t(n)
integer, len :: n = 1
character(n) :: c
end type
block
block
type(t(3)) :: x
x%c = 'abc'
print *, len(x%c)
end
end
end
$ gfortran-12-20211128 -c z1.f90
z1.f90:11:9:
11 | end
| 1
Error: END BLOCK statement expected at (1)
f951: internal compiler error: Segmentation fault
0xf0942f crash_signal
../../gcc/toplev.c:322
0x87a999 gfc_find_symtree(gfc_symtree*, char const*)
../../gcc/fortran/symbol.c:2979
0x87d157 gfc_find_sym_tree(char const*, gfc_namespace*, int, gfc_symtree**)
../../gcc/fortran/symbol.c:3224
0x87d2ae gfc_get_ha_sym_tree(char const*, gfc_symtree**)
../../gcc/fortran/symbol.c:3452
0x809fbe gfc_match_sym_tree(gfc_symtree**, int)
../../gcc/fortran/match.c:680
0x841bec match_variable
../../gcc/fortran/primary.c:4012
0x80a916 gfc_match(char const*, ...)
../../gcc/fortran/match.c:1137
0x80c1dd gfc_match_assignment()
../../gcc/fortran/match.c:1315
0x835a40 match_word
../../gcc/fortran/parse.c:67
0x835a40 decode_statement
../../gcc/fortran/parse.c:363
0x83753a next_free
../../gcc/fortran/parse.c:1397
0x83753a next_statement
../../gcc/fortran/parse.c:1629
0x83ad40 parse_executable
../../gcc/fortran/parse.c:5935
0x83c05f parse_progunit
../../gcc/fortran/parse.c:6205
0x83afbc parse_block_construct
../../gcc/fortran/parse.c:4873
0x83afbc parse_executable
../../gcc/fortran/parse.c:5786
0x83c05f parse_progunit
../../gcc/fortran/parse.c:6205
0x83d2a1 gfc_parse_file()
../../gcc/fortran/parse.c:6724
0x88b37f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:216