https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85111
Bug ID: 85111 Summary: [8 Regression] ICE in min_max_choose, at fortran/simplify.c:4884 (and others) Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Introduced between 20171217 and 20180107. Invalid code, occasionally similar for other basic types. $ cat za1.f90 program p integer, parameter :: a(2,0) = reshape([1,2,3,4], shape(a)) integer, parameter :: b(2) = maxloc(a, dim=1) end $ cat za2.f90 program p integer, parameter :: a(2,0) = reshape([1,2,3,4], shape(a)) integer, parameter :: b(2) = minloc(a, dim=1) end $ gfortran-8-20180325 -c za1.f90 f951: internal compiler error: Segmentation fault 0xb9c38f crash_signal ../../gcc/toplev.c:325 0x724896 min_max_choose ../../gcc/fortran/simplify.c:4884 0x724ed3 simplify_minmaxloc_to_array ../../gcc/fortran/simplify.c:5316 0x72ddb2 gfc_simplify_minmaxloc(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*, int) ../../gcc/fortran/simplify.c:5413 0x6b99e3 do_simplify ../../gcc/fortran/intrinsic.c:4442 0x6c408c gfc_intrinsic_func_interface(gfc_expr*, int) ../../gcc/fortran/intrinsic.c:4798 0x70de35 resolve_unknown_f ../../gcc/fortran/resolve.c:2870 0x70de35 resolve_function ../../gcc/fortran/resolve.c:3179 0x70df5a gfc_resolve_expr(gfc_expr*) ../../gcc/fortran/resolve.c:6709 0x6aad1f gfc_reduce_init_expr(gfc_expr*) ../../gcc/fortran/expr.c:2773 0x6ad821 gfc_match_init_expr(gfc_expr**) ../../gcc/fortran/expr.c:2821 0x69b2c2 variable_decl ../../gcc/fortran/decl.c:2642 0x69b2c2 gfc_match_data_decl() ../../gcc/fortran/decl.c:5838 0x6f60b9 match_word_omp_simd ../../gcc/fortran/parse.c:93 0x6f97ae match_word ../../gcc/fortran/parse.c:376 0x6f97ae decode_statement ../../gcc/fortran/parse.c:376 0x6fb6d4 next_free ../../gcc/fortran/parse.c:1230 0x6fb6d4 next_statement ../../gcc/fortran/parse.c:1462 0x6fcfcc parse_spec ../../gcc/fortran/parse.c:3854 0x6ff4b3 parse_progunit ../../gcc/fortran/parse.c:5667