https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95981
Bug ID: 95981 Summary: ICE in gfc_find_array_ref(): No ref found Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Affects also versions down to at least r5. With a missing attribute allocatable or pointer : $ cat z1.f90 program p type t end type class(t) :: x(:) type(t) :: y(size(x,1)) end $ gfortran-11-20200628 -c z1.f90 f951: internal compiler error: gfc_find_array_ref(): No ref found 0x657489 gfc_report_diagnostic ../../gcc/fortran/error.c:782 0x658baa gfc_internal_error(char const*, ...) ../../gcc/fortran/error.c:1402 0x628e4c gfc_find_array_ref(gfc_expr*, bool) ../../gcc/fortran/array.c:2750 0x629f7a dim_rank_check ../../gcc/fortran/check.c:1145 0x6317fc dim_rank_check ../../gcc/fortran/check.c:5140 0x6317fc gfc_check_size(gfc_expr*, gfc_expr*, gfc_expr*) ../../gcc/fortran/check.c:5135 0x66cf6c do_check ../../gcc/fortran/intrinsic.c:4749 0x66cf6c check_specific ../../gcc/fortran/intrinsic.c:4762 0x677264 gfc_intrinsic_func_interface(gfc_expr*, int) ../../gcc/fortran/intrinsic.c:4999 0x6c52d3 resolve_unknown_f ../../gcc/fortran/resolve.c:2902 0x6c52d3 resolve_function ../../gcc/fortran/resolve.c:3246 0x6c52d3 gfc_resolve_expr(gfc_expr*) ../../gcc/fortran/resolve.c:7037 0x64a4af variable_decl ../../gcc/fortran/decl.c:2595 0x64a4af gfc_match_data_decl() ../../gcc/fortran/decl.c:6197 0x6ae0a3 match_word ../../gcc/fortran/parse.c:65 0x6ae0a3 decode_statement ../../gcc/fortran/parse.c:376 0x6afaea next_free ../../gcc/fortran/parse.c:1280 0x6afaea next_statement ../../gcc/fortran/parse.c:1512 0x6b113b parse_spec ../../gcc/fortran/parse.c:3923 0x6b3f0c parse_progunit ../../gcc/fortran/parse.c:5852