Bug 88552 - ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1120
Summary: ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1120
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-19 16:11 UTC by G. Steinmetz
Modified: 2018-12-19 16:38 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-12-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2018-12-19 16:11:10 UTC
Without a program statement :


$ cat z1.f90
integer(len((c)) :: n
end


$ gfortran-9-20181216 -c z1.f90
$ gfortran-9-20181216 -c z1.f90 -fimplicit-none
z1.f90:1:0:

    1 | integer(len((c)) :: n
      |
internal compiler error: in gfc_typenode_for_spec, at fortran/trans-types.c:1120
0x78e59d gfc_typenode_for_spec(gfc_typespec*, int)
        ../../gcc/fortran/trans-types.c:1120
0x78c1f6 gfc_sym_type(gfc_symbol*)
        ../../gcc/fortran/trans-types.c:2243
0x71af9e gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1696
0x71ea47 generate_local_decl
        ../../gcc/fortran/trans-decl.c:5600
0x6d3d12 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4151
0x71ff9c generate_local_vars
        ../../gcc/fortran/trans-decl.c:5800
0x71ff9c gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6444
0x69d7c6 translate_all_program_units
        ../../gcc/fortran/parse.c:6128
0x69d7c6 gfc_parse_file()
        ../../gcc/fortran/parse.c:6331
0x6e6fcf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204


---

Invalid syntax also silently accepted :

$ cat z3.f90
integer(m::n
end


$ gfortran-9-20181216 -c z3.f90
$ gfortran-9-20181216 -c z3.f90 -fimplicit-none
z3.f90:1:0:

    1 | integer(m::n
      |
internal compiler error: in gfc_typenode_for_spec, at fortran/trans-types.c:1120
#...
Comment 1 G. Steinmetz 2018-12-19 16:11:57 UTC
Detected :


$ cat z2.f90
program p
integer(len((c)) :: n
end


$ cat z5.f90
implicit none
integer(len((c)) :: n
end


$ gfortran-9-20181216 -c z2.f90 -fimplicit-none
z2.f90:2:14:

    2 | integer(len((c)) :: n
      |              1
Error: Symbol 'c' at (1) has no IMPLICIT type
Comment 2 Dominique d'Humieres 2018-12-19 16:38:48 UTC
Confirmed from at least 4.8 up to trunk (9.0).