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

            Bug ID: 77961
           Summary: ICE: verify_type failed, at tree.c:14085 ;
                    gen_type_die_with_usage, at dwarf2out.c:22942
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

ICE observed with test version gfortran-7-20160925 and newer.
No ICE with gfortran-7-20160918 and older.
Needs option -g :


$ cat z1.f90
program p
   type t
   end type
   type t2
      type(t), allocatable :: c(:)
   end type
   type(t2) :: x[*]
   allocate (x%c(2), source=t())
contains
   subroutine s(x)
      class(*) :: x[*]
   end
end


$ gfortran-7-20161009 -g -fcoarray=single -c z1.f90
$ gfortran-7-20161009 -g -fcoarray=lib -c z1.f90
z1.f90:12:0:

    end

Error: TYPE_CANONICAL is not compatible
 <record_type 0x2b1647957540 array_descriptor1 asm_written BLK
    size <integer_cst 0x2b164794b108 type <integer_type 0x2b16477702a0
bitsizetype> constant 384>
    unit size <integer_cst 0x2b1647920c18 type <integer_type 0x2b16477701f8
sizetype> constant 48>
    align 64 symtab 1200810336 alias set -1 canonical type 0x2b1647957540
    fields <field_decl 0x2b1647956260 data
        type <pointer_type 0x2b16477852a0 type <void_type 0x2b1647785150 void>
            asm_written public unsigned DI
            size <integer_cst 0x2b164776cbb8 constant 64>
            unit size <integer_cst 0x2b164776cbd0 constant 8>
            align 64 symtab 1200808976 alias set -1 canonical type
0x2b16477852a0
            pointer_to_this <pointer_type 0x2b164778b9d8>>
        unsigned DI file z1.f90 line 10 col 0 size <integer_cst 0x2b164776cbb8
64> unit size <integer_cst 0x2b164776cbd0 8>
        align 64 offset_align 128
        offset <integer_cst 0x2b164776cbe8 constant 0>
        bit offset <integer_cst 0x2b164776cc30 constant 0> context <record_type
0x2b1647957540 array_descriptor1>
        chain <field_decl 0x2b16479562f8 offset type <integer_type
0x2b1647770930 integer(kind=8)>
            DI file z1.f90 line 10 col 0 size <integer_cst 0x2b164776cbb8 64>
unit size <integer_cst 0x2b164776cbd0 8>
            align 64 offset_align 128 offset <integer_cst 0x2b164776cbe8 0> bit
offset <integer_cst 0x2b164776cbb8 64> context <record_type 0x2b1647957540
array_descriptor1> chain <field_decl 0x2b1647956390 dtype>>>
    pointer_to_this <pointer_type 0x2b164795d000> chain <type_decl
0x2b16479564c0 D.3468>>
 <record_type 0x2b1647957888 array1_t type_1 BLK
    size <integer_cst 0x2b1647920db0 type <integer_type 0x2b16477702a0
bitsizetype> constant 448>
    unit size <integer_cst 0x2b1647920de0 type <integer_type 0x2b16477701f8
sizetype> constant 56>
    align 64 symtab 0 alias set -1 canonical type 0x2b1647957540
    fields <field_decl 0x2b1647956850 data
        type <pointer_type 0x2b164778b930 type <void_type 0x2b1647785150 void>
            unsigned restrict DI
            size <integer_cst 0x2b164776cbb8 constant 64>
            unit size <integer_cst 0x2b164776cbd0 constant 8>
            align 64 symtab 1200988480 alias set -1 canonical type
0x2b164778b930>
        unsigned DI file z1.f90 line 12 col 0 size <integer_cst 0x2b164776cbb8
64> unit size <integer_cst 0x2b164776cbd0 8>
        align 64 offset_align 128
        offset <integer_cst 0x2b164776cbe8 constant 0>
        bit offset <integer_cst 0x2b164776cc30 constant 0> context <record_type
0x2b1647957690 array_descriptor1>
        chain <field_decl 0x2b16479568e8 offset type <integer_type
0x2b1647770930 integer(kind=8)>
            DI file z1.f90 line 12 col 0 size <integer_cst 0x2b164776cbb8 64>
unit size <integer_cst 0x2b164776cbd0 8>
            align 64 offset_align 128 offset <integer_cst 0x2b164776cbe8 0> bit
offset <integer_cst 0x2b164776cbb8 64> context <record_type 0x2b1647957690
array_descriptor1> chain <field_decl 0x2b1647956980 dtype>>>
    pointer_to_this <pointer_type 0x2b1647957d20> chain <type_decl
0x2b16479564c0 D.3468>>
z1.f90:12:0: internal compiler error: verify_type failed
0xee98e2 verify_type(tree_node const*)
        ../../gcc/tree.c:14085
0x8c25ec gen_type_die_with_usage
        ../../gcc/dwarf2out.c:22942
0x8c3c36 gen_type_die
        ../../gcc/dwarf2out.c:23140
0x8b7ed0 gen_decl_die
        ../../gcc/dwarf2out.c:23794
0x8cb015 gen_member_die
        ../../gcc/dwarf2out.c:22611
0x8cb015 gen_struct_or_union_type_die
        ../../gcc/dwarf2out.c:22717
0x8cb015 gen_tagged_type_die
        ../../gcc/dwarf2out.c:22920
0x8c2c5c gen_type_die_with_usage
        ../../gcc/dwarf2out.c:23085
0x8c3c36 gen_type_die
        ../../gcc/dwarf2out.c:23140
0x8b83a9 gen_decl_die
        ../../gcc/dwarf2out.c:23739
0x8b8d86 dwarf2out_decl
        ../../gcc/dwarf2out.c:24213
0x8d3b84 dwarf2out_type_decl
        ../../gcc/dwarf2out.c:23921
0xb5a0bf rest_of_type_compilation(tree_node*, int)
        ../../gcc/passes.c:333
0x7b3b03 gfc_finish_type(tree_node*)
        ../../gcc/fortran/trans-types.c:2247
0x7b74d4 gfc_get_derived_type(gfc_symbol*, bool)
        ../../gcc/fortran/trans-types.c:2711
0x7b7c9c gfc_typenode_for_spec(gfc_typespec*, bool)
        ../../gcc/fortran/trans-types.c:1110
0x7b5cc3 gfc_sym_type(gfc_symbol*)
        ../../gcc/fortran/trans-types.c:2167
0x74eb24 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1640
0x752767 generate_local_decl
        ../../gcc/fortran/trans-decl.c:5313
0x70dfcb do_traverse_symtree
        ../../gcc/fortran/symbol.c:3962

Reply via email to