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

            Bug ID: 107559
           Summary: ICE in resolve_equivalence, at
                    fortran/resolve.cc:17230
           Product: gcc
           Version: 13.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
module m
   implicit none
   integer, protected :: a
   integer :: b
   equivalence (a, b)
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:5:18:

    5 |    equivalence (a, b)
      |                  1
Error: Either all or none of the objects in the EQUIVALENCE set at (1) shall
have the PROTECTED attribute


$ gfortran-13-20221106 -c z1.f90 -std=f95
z1.f90:3:25:

    3 |    integer, protected :: a
      |                         1
Error: Fortran 2003: PROTECTED attribute at (1)
z1.f90:5:17:

    5 |    equivalence (a, b)
      |                 1
Error: Symbol 'a' at (1) has no IMPLICIT type

Segmentation fault
0xf4697f crash_signal
        ../../gcc/toplev.cc:314
0x7faa18 gfc_format_decoder
        ../../gcc/fortran/error.cc:1071
0x1f8bff0 pp_format(pretty_printer*, text_info*)
        ../../gcc/pretty-print.cc:1475
0x1f6af10 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.cc:1548
0x7fabd9 gfc_report_diagnostic
        ../../gcc/fortran/error.cc:883
0x7fad68 gfc_error_opt
        ../../gcc/fortran/error.cc:1453
0x7fbb20 gfc_notify_std(int, char const*, ...)
        ../../gcc/fortran/error.cc:1037
0x87f5de resolve_equivalence
        ../../gcc/fortran/resolve.cc:17230
0x87f5de resolve_types
        ../../gcc/fortran/resolve.cc:17575
0x87a43c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.cc:17657
0x862012 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6837
0x8b0c8f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:229

Reply via email to