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

            Bug ID: 83184
           Summary: Out of memory or ICE with option -fdec
           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: ---

With invalid code and option -fdec-structure or -fdec :

$ cat z1.f90
program p
   structure /s/
      integer n(..) /1/
   end structure
end

$ cat z2.f90
program p
   structure /s/
      integer n(..) /2*1/
   end structure
end


$ gfortran-8-20171126 -c z1.f90 -fdec
f951: out of memory allocating 18446744073709551600 bytes after a total of
499712 bytes

---

Configured with --enable-checking=yes :

$ gfortran-8-20171126-chk -c z1.f90
z1.f90:2:12:

    structure /s/
            1
Error: STRUCTURE at (1) is a DEC extension, enable with '-fdec-structure'
z1.f90:4:6:

    end structure
      1
Error: Expecting END PROGRAM statement at (1)
z1.f90:3:19:

       integer n(..) /1/
                   1
Error: Assumed-rank array at (1) must be a dummy argument

in gfc_format_decoder, at fortran/error.c:934
0x6be93e gfc_format_decoder
        ../../gcc/fortran/error.c:934
0x152fe43 pp_format(pretty_printer*, text_info*)
        ../../gcc/pretty-print.c:1351
0x152033b diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.c:984
0x6be7a7 gfc_error_opt
        ../../gcc/fortran/error.c:1299
0x6bfce0 gfc_error(char const*, ...)
        ../../gcc/fortran/error.c:1328
0x7279f6 resolve_variable
        ../../gcc/fortran/resolve.c:5267
0x7279f6 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:6706
0x72b238 resolve_data_variables
        ../../gcc/fortran/resolve.c:15504
0x733f30 resolve_data
        ../../gcc/fortran/resolve.c:15529
0x733f30 resolve_types
        ../../gcc/fortran/resolve.c:16356
0x72f6ac gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:16445
0x71903a resolve_all_program_units
        ../../gcc/fortran/parse.c:6031
0x71903a gfc_parse_file()
        ../../gcc/fortran/parse.c:6281
0x75e67f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204

Reply via email to