https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92017

            Bug ID: 92017
           Summary: ICE in gfc_expr_attr, at fortran/primary.c:2674
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Starting with gfortran-8 :


$ cat z1.f90
program p
   character(3), parameter :: a(4) = 'abc'
   integer, parameter :: b(1) = minloc(a)
   integer, parameter :: c = minloc(a, dim=1)
end


$ cat z2.f90
program p
   character(3), parameter :: a(4) = 'abc'
   integer, parameter :: b(1) = maxloc(a)
   integer, parameter :: c = maxloc(a, dim=1)
end


$ gfortran-10-20191006 -c z1.f90
f951: internal compiler error: Segmentation fault
0xb5d4ef crash_signal
        ../../gcc/toplev.c:326
0x684278 gfc_expr_attr(gfc_expr*)
        ../../gcc/fortran/primary.c:2674
0x62516a gfc_extract_hwi(gfc_expr*, long*, int)
        ../../gcc/fortran/expr.c:698
0x6ae218 init_result_expr
        ../../gcc/fortran/simplify.c:329
0x6ae65e gfc_simplify_minmaxloc
        ../../gcc/fortran/simplify.c:5430
0x637a4f do_simplify
        ../../gcc/fortran/intrinsic.c:4574
0x64209e gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:4942
0x699e61 resolve_unknown_f
        ../../gcc/fortran/resolve.c:2894
0x699e61 resolve_function
        ../../gcc/fortran/resolve.c:3231
0x696275 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:6967
0x627ea4 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:3048
0x62b020 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:3096
0x617093 variable_decl
        ../../gcc/fortran/decl.c:2841
0x617093 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6087
0x6780c3 match_word
        ../../gcc/fortran/parse.c:65
0x6780c3 decode_statement
        ../../gcc/fortran/parse.c:376
0x679b0a next_free
        ../../gcc/fortran/parse.c:1263
0x679b0a next_statement
        ../../gcc/fortran/parse.c:1495
0x67b12b parse_spec
        ../../gcc/fortran/parse.c:3893
0x67df1c parse_progunit
        ../../gcc/fortran/parse.c:5812

Reply via email to