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

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

A legacy extension changed between 20191103 and 20191110 :


$ cat z1.f90
program p
   print *, -[integer :: 1, [integer(8) :: '2']]
end


$ cat z7.f90
program p
   print *,  +[integer :: 1, [integer(8) :: '2']]
   print *, 1-[integer :: 1, [integer(8) :: '2']]
   print *, 1*[integer :: 1, [integer(8) :: '2']]
   print *,   [integer :: 1, [integer(8) :: '2']]/2
   !...
end


$ gfortran-10-20191103 -c z1.f90 -fdec
z1.f90:2:42:

    2 |    print *, -[integer :: 1, [integer(8) :: '2']]
      |                                          1
Error: Cannot convert CHARACTER(1) to INTEGER(8) at (1)
$
$ gfortran-10-20191208 -c z1.f90 -fdec -fno-range-check
$
$ gfortran-10-20191208 -c z1.f90 -fdec
f951: internal compiler error: Segmentation fault
0xd05dff crash_signal
        ../../gcc/toplev.c:328
0x62791b reduce_unary
        ../../gcc/fortran/arith.c:1283
0x6278ef reduce_unary
        ../../gcc/fortran/arith.c:1270
0x62813f eval_intrinsic
        ../../gcc/fortran/arith.c:1609
0x696b64 match_level_2
        ../../gcc/fortran/matchexp.c:490
0x696b82 match_level_3
        ../../gcc/fortran/matchexp.c:551
0x696c74 match_level_4
        ../../gcc/fortran/matchexp.c:599
0x696c74 match_and_operand
        ../../gcc/fortran/matchexp.c:693
0x696e62 match_or_operand
        ../../gcc/fortran/matchexp.c:722
0x696f32 match_equiv_operand
        ../../gcc/fortran/matchexp.c:765
0x697004 match_level_5
        ../../gcc/fortran/matchexp.c:811
0x6963e1 gfc_match_expr(gfc_expr**)
        ../../gcc/fortran/matchexp.c:870
0x67dd39 match_io_element
        ../../gcc/fortran/io.c:3729
0x6806c5 match_io_list
        ../../gcc/fortran/io.c:3777
0x680ad4 match_io
        ../../gcc/fortran/io.c:4476
0x6847fa gfc_match_print()
        ../../gcc/fortran/io.c:4533
0x6b0051 match_word
        ../../gcc/fortran/parse.c:65
0x6b49e3 decode_statement
        ../../gcc/fortran/parse.c:537
0x6b4e1a next_free
        ../../gcc/fortran/parse.c:1279
0x6b4e1a next_statement
        ../../gcc/fortran/parse.c:1511

Reply via email to