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

            Bug ID: 88116
           Summary: [8/9 Regression] ICE in gfc_convert_constant():
                    Unexpected type
           Product: gcc
           Version: 9.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 for versions 8/9, silently accepted with 5/6/7  :


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


$ gfortran-9-20181118 -c z1.f90
f951: internal compiler error: gfc_convert_constant(): Unexpected type
0x61a501 gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.c:1363
0x6a759c gfc_convert_constant(gfc_expr*, bt, int)
        ../../gcc/fortran/simplify.c:8363
0x6a761a gfc_convert_constant(gfc_expr*, bt, int)
        ../../gcc/fortran/simplify.c:8396
0x62d3cb do_simplify
        ../../gcc/fortran/intrinsic.c:4475
0x638452 gfc_convert_type_warn(gfc_expr*, gfc_typespec*, int, int)
        ../../gcc/fortran/intrinsic.c:5148
0x5ece92 gfc_match_array_constructor(gfc_expr**)
        ../../gcc/fortran/array.c:1249
0x650479 match_primary
        ../../gcc/fortran/matchexp.c:153
0x650479 match_level_1
        ../../gcc/fortran/matchexp.c:211
0x650479 match_mult_operand
        ../../gcc/fortran/matchexp.c:267
0x6506d8 match_add_operand
        ../../gcc/fortran/matchexp.c:356
0x65092c match_level_2
        ../../gcc/fortran/matchexp.c:480
0x650a82 match_level_3
        ../../gcc/fortran/matchexp.c:551
0x650b74 match_level_4
        ../../gcc/fortran/matchexp.c:599
0x650b74 match_and_operand
        ../../gcc/fortran/matchexp.c:693
0x650d62 match_or_operand
        ../../gcc/fortran/matchexp.c:722
0x650e32 match_equiv_operand
        ../../gcc/fortran/matchexp.c:765
0x650f04 match_level_5
        ../../gcc/fortran/matchexp.c:811
0x6502e1 gfc_match_expr(gfc_expr**)
        ../../gcc/fortran/matchexp.c:870
0x638e23 match_io_element
        ../../gcc/fortran/io.c:3587
0x63b795 match_io_list
        ../../gcc/fortran/io.c:3626


---

Silently accepted invalid code, produces a wrong result :


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


$ gfortran-9-20181118 z2.f90 -static-libgfortran
$ a.out
           1           2           0

Reply via email to