[Bug fortran/92961] New: [8/9/10 Regression] ICE in gfc_zero_size_array, at fortran/arith.c:1680

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Mon Dec 16 20:09:00 GMT 2019


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

            Bug ID: 92961
           Summary: [8/9/10 Regression] ICE in gfc_zero_size_array, at
                    fortran/arith.c:1680
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

With an expression (0) :


$ cat z1.f90
program p
   integer :: a((0)/0)
   integer :: b(0/(0))
   integer :: c((0)/(0))
end


$ gfortran-5 -c z1.f90
z1.f90:2:17:

    integer :: a((0)/0)
                 1
Error: Division by zero at (1)
z1.f90:2:22:

    integer :: a((0)/0)
                      1
Error: The module or main program array 'a' at (1) must have constant shape
z1.f90:3:17:

    integer :: b(0/(0))
                 1
Error: Division by zero at (1)
z1.f90:3:22:

    integer :: b(0/(0))
                      1
Error: The module or main program array 'b' at (1) must have constant shape
z1.f90:4:17:

    integer :: c((0)/(0))
                 1
Error: Division by zero at (1)
z1.f90:4:24:

    integer :: c((0)/(0))
                        1
Error: The module or main program array 'c' at (1) must have constant shape


$ gfortran-10-20191215 -c z1.f90
f951: internal compiler error: Segmentation fault
0xb8147f crash_signal
        ../../gcc/toplev.c:328
0x5f6d9b gfc_zero_size_array
        ../../gcc/fortran/arith.c:1680
0x5f6d9b reduce_binary0
        ../../gcc/fortran/arith.c:1694
0x5f6d9b eval_intrinsic_f3
        ../../gcc/fortran/arith.c:1743
0x63139a simplify_intrinsic_op
        ../../gcc/fortran/expr.c:1196
0x63139a gfc_simplify_expr(gfc_expr*, int)
        ../../gcc/fortran/expr.c:2201
0x61e611 variable_decl
        ../../gcc/fortran/decl.c:2565
0x61e611 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6098
0x6815a3 match_word
        ../../gcc/fortran/parse.c:65
0x6815a3 decode_statement
        ../../gcc/fortran/parse.c:376
0x682fea next_free
        ../../gcc/fortran/parse.c:1279
0x682fea next_statement
        ../../gcc/fortran/parse.c:1511
0x685394 parse_spec
        ../../gcc/fortran/parse.c:3738
0x68740c parse_progunit
        ../../gcc/fortran/parse.c:5848
0x688ae9 gfc_parse_file()
        ../../gcc/fortran/parse.c:6388
0x6d365f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:210


More information about the Gcc-bugs mailing list