[Bug fortran/101069] New: ICE in gfc_resolve_expr, at fortran/resolve.c:7087

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Mon Jun 14 17:19:37 GMT 2021


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

            Bug ID: 101069
           Summary: ICE in gfc_resolve_expr, at fortran/resolve.c:7087
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

The ICE is always reproducible with gcc-11-20201004 and newer on
my environment, and never with gcc-11-20200823, but ICEs sometimes
sporadically for older versions too. Other brands may also stumble.


$ cat z1.f90
program p
   character(*), parameter :: x(2) = [character(n) :: 'a', 'b']
end


$ gfortran-12-20210613 -c z1.f90   # configured with --enable-checking=yes
z1.f90:2:34:

    2 |    character(*), parameter :: x(2) = [character(n) :: 'a', 'b']
      |                                  1
Error: Cannot initialize parameter array at (1) with variable length elements
f951: internal compiler error: Segmentation fault
0xe1963f crash_signal
        ../../gcc/toplev.c:327
0x798173 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:7087
0x79a9d4 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:12525
0x79a9d4 resolve_charlen
        ../../gcc/fortran/resolve.c:12475
0x7a6c29 resolve_charlen
        ../../gcc/fortran/resolve.c:12466
0x7a6c29 resolve_types
        ../../gcc/fortran/resolve.c:17344
0x7a227c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:17461
0x78a7b4 resolve_all_program_units
        ../../gcc/fortran/parse.c:6400
0x78a7b4 gfc_parse_file()
        ../../gcc/fortran/parse.c:6652
0x7d7dcf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212


More information about the Gcc-bugs mailing list