https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117901
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de, | |rguenth at gcc dot gnu.org, | |vehre at gcc dot gnu.org --- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> --- This rather minimal testcase below is sufficient to generate the fault with no more than the option -O3. In 'class_rebar', s/class(*)/class(t) plus definition of type t/ also gives the error. Note that there are no transformational intrinsics of class variables involved and this bug appears to have uncovered two problems: (i) with gcc-12.2.1 [pault@pc30 pr102689]$ gfortran -Wall -static-libgfortran class_transformational_4.f90 -O3 during IPA pass: inline f951: internal compiler error: in make_ssa_name_fn, at tree-ssanames.cc:288 Please submit a full bug report... So the internal error has appeared since then. (ii) The other is the ICE itself. Both empty rank cases are need. I am at a complete loss as to how to diagnose this further. I can well believe that there is a missing DECL_EXPR but I don't know where. Paul Reduced testcase: Module class_tests contains subroutine class_rebar (arg) class(*), allocatable :: arg(:) call class_bar (arg) end subroutine class_bar(x) class(*), intent(in) :: x(..) integer :: checksum select rank (x) rank (1) select type (x) type is (character(*)) checksum = sum(ichar(x(:)(1:1)) + ichar(x(:)(2:2))) print *, checksum end select rank (2) rank (3) end select end end module class_tests