https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103413
Bug ID: 103413 Summary: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started with r10, between 20190630 and 20190728 : $ cat z1.f90 program p type t class(*), allocatable :: a end type type(t) :: x allocate (x%a, source=z'1') end $ cat z2.f90 program p type t class(*), allocatable :: a end type type(t) :: x allocate (x%a, mold=z'1') end $ cat z3.f90 program p type t class(*), pointer :: a end type type(t) :: x allocate (x%a, mold=z'1') end $ gfortran-12-20211121 -c z1.f90 f951: internal compiler error: Invalid expression in gfc_element_size. 0x796be9 gfc_report_diagnostic ../../gcc/fortran/error.c:874 0x798757 gfc_internal_error(char const*, ...) ../../gcc/fortran/error.c:1494 0x83c8f2 gfc_element_size(gfc_expr*, unsigned long*) ../../gcc/fortran/target-memory.c:137 0x778ca2 find_intrinsic_vtab ../../gcc/fortran/class.c:2774 0x778ca2 gfc_find_vtab(gfc_typespec*) ../../gcc/fortran/class.c:2926 0x80fd4e resolve_allocate_expr ../../gcc/fortran/resolve.c:8039 0x80fd4e resolve_allocate_deallocate ../../gcc/fortran/resolve.c:8419 0x811c81 gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc/fortran/resolve.c:12208 0x813297 resolve_codes ../../gcc/fortran/resolve.c:17536 0x81335e gfc_resolve(gfc_namespace*) ../../gcc/fortran/resolve.c:17571 0x7fb614 resolve_all_program_units ../../gcc/fortran/parse.c:6573 0x7fb614 gfc_parse_file() ../../gcc/fortran/parse.c:6829 0x848a6f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:216