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

            Bug ID: 86045
           Summary: ICE in reduce_binary_ac, at fortran/arith.c:1308 (and
                    others)
           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: ---

This invalid code affects versions down to at least 4.8 :


$ cat z1.f90
program p
   logical :: a(2) = (mod([2,3],0) == 0)
   integer :: b = count(mod([2,3],0) == 0)
   integer :: c = all(mod([2,3],0) == 0)
   integer :: d = any(mod([2,3],0) == 0)
end


$ gfortran-9-20180603 -c z1.f90
f951: internal compiler error: Segmentation fault
0xba15af crash_signal
        ../../gcc/toplev.c:325
0x675138 reduce_binary_ac
        ../../gcc/fortran/arith.c:1308
0x6750d2 reduce_binary_ac
        ../../gcc/fortran/arith.c:1295
0x67531c reduce_binary
        ../../gcc/fortran/arith.c:1421
0x675b3b eval_intrinsic
        ../../gcc/fortran/arith.c:1596
0x675d9e eval_intrinsic_f3
        ../../gcc/fortran/arith.c:1733
0x6ac5a5 simplify_intrinsic_op
        ../../gcc/fortran/expr.c:1158
0x6ac5a5 gfc_simplify_expr(gfc_expr*, int)
        ../../gcc/fortran/expr.c:1984
0x6ab947 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:2775
0x6ae431 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:2821
0x69bfb9 variable_decl
        ../../gcc/fortran/decl.c:2681
0x69bfb9 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:5880
0x6f6fb9 match_word_omp_simd
        ../../gcc/fortran/parse.c:93
0x6fa6ae match_word
        ../../gcc/fortran/parse.c:376
0x6fa6ae decode_statement
        ../../gcc/fortran/parse.c:376
0x6fc5d4 next_free
        ../../gcc/fortran/parse.c:1230
0x6fc5d4 next_statement
        ../../gcc/fortran/parse.c:1462
0x6fe3ec parse_spec
        ../../gcc/fortran/parse.c:3670
0x7003b3 parse_progunit
        ../../gcc/fortran/parse.c:5667
0x701994 gfc_parse_file()
        ../../gcc/fortran/parse.c:6207

Reply via email to