https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85687
Bug ID: 85687 Summary: ICE in gfc_sym_identifier, at fortran/trans-decl.c:351 Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Feeding F2018 intrinsic function RANK with an illegal argument (t is not a constant or variable) is silently accepted with -std=f2018, but gives an ICE with -std=f2008 or older. $ cat z1.f90 program p type t end type print *, rank(t) end $ cat z2.f90 program p type t integer :: n end type print *, rank(t) end $ gfortran-9-20180506 -c z1.f90 -std=f2018 $ $ gfortran-9-20180506 -c z1.f90 -std=f2008 z1.f90:2:0: type t internal compiler error: Segmentation fault 0xb9e99f crash_signal ../../gcc/toplev.c:325 0x766aa0 gfc_sym_identifier ../../gcc/fortran/trans-decl.c:351 0x767993 build_function_decl ../../gcc/fortran/trans-decl.c:2274 0x76eca3 gfc_get_symbol_decl(gfc_symbol*) ../../gcc/fortran/trans-decl.c:1695 0x781e7f gfc_conv_variable ../../gcc/fortran/trans-expr.c:2554 0x77eb62 gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.c:7930 0x7853be gfc_conv_expr_reference(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.c:8030 0x77a8c0 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*) ../../gcc/fortran/trans-expr.c:5273 0x77e5fc gfc_conv_function_expr ../../gcc/fortran/trans-expr.c:6812 0x77eb42 gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.c:7922 0x785268 gfc_conv_expr_reference(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.c:8057 0x7a5396 gfc_trans_transfer(gfc_code*) ../../gcc/fortran/trans-io.c:2585 0x74ae97 trans_code ../../gcc/fortran/trans.c:2044 0x7a2e47 build_dt ../../gcc/fortran/trans-io.c:2027 0x74aeb7 trans_code ../../gcc/fortran/trans.c:2016 0x772499 gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6507 0x7015e0 translate_all_program_units ../../gcc/fortran/parse.c:6121 0x7015e0 gfc_parse_file() ../../gcc/fortran/parse.c:6324 0x74832f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:204