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

            Bug ID: 104210
           Summary: [11/12 Regression] ICE in gfc_zero_size_array, at
                    fortran/arith.cc:1685
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20200628 and 20200705 :
(both with -fcoarray=single and -fcoarray=lib)


$ cat z1.f90
function f()
   integer :: f[*]
end
program p
   interface
      function f()
         integer :: f[*]
      end
   end interface
end


$ cat z2.f90
function f()
   integer :: f(2)[*]
end
program p
   interface
      function f()
         integer :: f(2)[*]
      end
   end interface
end


$ gfortran-12-20220123 -c z1.f90 -fcoarray=lib
z1.f90:1:0:

    1 | function f()
      |
Error: Function result 'f' at (1) shall not be a coarray or have a coarray
component
z1.f90:6:6:

    6 |       function f()
      |      1
Error: Function result 'f' at (1) shall not be a coarray or have a coarray
component
f951: internal compiler error: Segmentation fault
0xe6bd5f crash_signal
        ../../gcc/toplev.cc:322
0x6f5815 gfc_zero_size_array
        ../../gcc/fortran/arith.cc:1685
0x6f5815 reduce_binary0
        ../../gcc/fortran/arith.cc:1699
0x6f5815 eval_intrinsic_f3
        ../../gcc/fortran/arith.cc:1751
0x73af4d gfc_check_result_characteristics(gfc_symbol*, gfc_symbol*, char*, int)
        ../../gcc/fortran/interface.cc:1664
0x73b3c8 gfc_compare_interfaces(gfc_symbol*, gfc_symbol*, char const*, int,
int, char*, int, char const*, char const*, bool*)
        ../../gcc/fortran/interface.cc:1745
0x8a337b check_against_globals
        ../../gcc/fortran/frontend-passes.cc:5834
0x7c9922 do_traverse_symtree
        ../../gcc/fortran/symbol.cc:4174
0x8aa8b1 gfc_check_externals(gfc_namespace*)
        ../../gcc/fortran/frontend-passes.cc:5874
0x791522 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6869
0x7df71f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:216

Reply via email to