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

            Bug ID: 93483
           Summary: ICE in gfc_constructor_copy, at
                    fortran/constructor.c:103
           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: ---

While z0 works, special case z1 does not; down to at least r5 :


$ cat z0.f90
program p
   integer, parameter :: a(2) = [1, 2]
   print *, [real :: a]
   print *, [real :: -a]
   print *, -[real :: a]
   print *, -[real :: -a]
   print *
   print *, [real :: [1, 2]]
   print *, [real :: -[1, 2]]
   print *, -[real :: [1, 2]]
end


$ cat z1.f90
program p
   print *, -[real :: -[1, 2]]
   print *, +[real :: +[1, 2]]
end


$ gfortran-10-20200126 z0.f90 && ./a.out
   1.00000000       2.00000000
  -1.00000000      -2.00000000
  -1.00000000      -2.00000000
   1.00000000       2.00000000

   1.00000000       2.00000000
  -1.00000000      -2.00000000
  -1.00000000      -2.00000000


$ gfortran-10-20200126 -c z1.f90
f951: internal compiler error: Segmentation fault
0xbac5cf crash_signal
        ../../gcc/toplev.c:328
0x151181c splay_tree_foreach
        ../../libiberty/splay-tree.c:577
0x62d574 gfc_constructor_copy(splay_tree_s*)
        ../../gcc/fortran/constructor.c:103
0x61431b reduce_unary
        ../../gcc/fortran/arith.c:1269
0x61433f reduce_unary
        ../../gcc/fortran/arith.c:1272
0x614b8f eval_intrinsic
        ../../gcc/fortran/arith.c:1611
0x6836c4 match_level_2
        ../../gcc/fortran/matchexp.c:490
0x6836e2 match_level_3
        ../../gcc/fortran/matchexp.c:551
0x6837d4 match_level_4
        ../../gcc/fortran/matchexp.c:599
0x6837d4 match_and_operand
        ../../gcc/fortran/matchexp.c:693
0x6839c2 match_or_operand
        ../../gcc/fortran/matchexp.c:722
0x683a92 match_equiv_operand
        ../../gcc/fortran/matchexp.c:765
0x683b64 match_level_5
        ../../gcc/fortran/matchexp.c:811
0x682f41 gfc_match_expr(gfc_expr**)
        ../../gcc/fortran/matchexp.c:870
0x66a809 match_io_element
        ../../gcc/fortran/io.c:3729
0x66d195 match_io_list
        ../../gcc/fortran/io.c:3777
0x66d5a4 match_io
        ../../gcc/fortran/io.c:4476
0x6712ca gfc_match_print()
        ../../gcc/fortran/io.c:4533
0x69d0c1 match_word
        ../../gcc/fortran/parse.c:65
0x6a1a53 decode_statement
        ../../gcc/fortran/parse.c:537

Reply via email to