https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104352
Bug ID: 104352 Summary: ICE in gfc_conv_intrinsic_anyall, at fortran/trans-intrinsic.cc:4481 (etc.) 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: --- Affects versions down to at least r5 : $ cat z1.f90 program p integer, parameter :: a(0) = 1 print *, any(a(1:1) == 1) end $ cat z2.f90 program p integer, parameter :: a(0) = 1 print *, any(a(:1) == 1) end $ cat z3.f90 program p integer, parameter :: a(0) = 1 print *, any(a(0:0) == 1) end $ cat z4.f90 program p integer, parameter :: a(0) = 1 print *, any(a(0:1) == 1) end $ gfortran-12-20220130 -c z1.f90 z1.f90:3:18: 3 | print *, any(a(1:1) == 1) | 1 Warning: Lower array reference at (1) is out of bounds (1 > 0) in dimension 1 z1.f90:3:18: 3 | print *, any(a(1:1) == 1) | 1 Warning: Lower array reference at (1) is out of bounds (1 > 0) in dimension 1 z1.f90:3:28: 3 | print *, any(a(1:1) == 1) | 1 internal compiler error: in gfc_conv_intrinsic_anyall, at fortran/trans-intrinsic.cc:4481 0x7f5fb3 gfc_conv_intrinsic_anyall ../../gcc/fortran/trans-intrinsic.cc:4481 0x802c56 gfc_conv_intrinsic_anyall ../../gcc/fortran/trans-intrinsic.cc:4463 0x802c56 gfc_conv_intrinsic_function(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-intrinsic.cc:10228 0x7d6dba gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.cc:9398 0x7de952 gfc_conv_expr_reference(gfc_se*, gfc_expr*, bool) ../../gcc/fortran/trans-expr.cc:9544 0x808f57 gfc_trans_transfer(gfc_code*) ../../gcc/fortran/trans-io.cc:2581 0x7a6067 trans_code ../../gcc/fortran/trans.cc:2136 0x806a3e build_dt ../../gcc/fortran/trans-io.cc:2025 0x7a6047 trans_code ../../gcc/fortran/trans.cc:2108 0x7cf19e gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.cc:7654 0x751efe translate_all_program_units ../../gcc/fortran/parse.cc:6651 0x751efe gfc_parse_file() ../../gcc/fortran/parse.cc:6938 0x79eecf gfc_be_parse_file ../../gcc/fortran/f95-lang.cc:216