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

            Bug ID: 104684
           Summary: ICE: 'verify_gimple' failed (Error: non-trivial
                    conversion in 'component_ref')
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gfortran-12.0.1 20220220 snapshot (g:e49508ac6b36adb8a2056c5a1fb6e0178de2439d)
ICEs when compiling the following testcase, reduced from
gfortran-bugs/gfortran-20220127.f90 from the Neil Carlson's Fortran Compiler
Tests repository[1], w/ -fcoarray=single or -fcoarray=none:

program main
  type :: index_map
    integer, allocatable :: send_index(:)
  end type
  type(index_map) :: imap
contains
  subroutine sub(this)
    type(index_map), intent(inout), target :: this
    type :: box
      integer, pointer :: array(:)
    end type
    type(box), allocatable :: buffer[:]
    allocate(buffer[*])
    buffer%array => this%send_index
  end subroutine
end program

% gfortran-12.0.1 -fcoarray=single -c ft2kqibk.f90
ft2kqibk.f90:7:16:

    7 |   subroutine sub(this)
      |                ^
Error: non-trivial conversion in 'component_ref'
struct array02_integer(kind=4)
struct array01_integer(kind=4)
MEM[(struct box *)_5].array = this->send_index;
ft2kqibk.f90:7:16: internal compiler error: 'verify_gimple' failed
0xf9af9d verify_gimple_in_seq(gimple*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/tree-cfg.cc:5213
0xc8b185 gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/gimplify.cc:16313
0xc8b34c gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/gimplify.cc:16384
0xfffc18 gimplify_all_functions
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/tree-nested.cc:3703
0xfffc07 gimplify_all_functions
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/tree-nested.cc:3707
0x1005f40 lower_nested_functions(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/tree-nested.cc:3724
0xaa3143 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/cgraphunit.cc:681
0xaa6047 analyze_functions
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/cgraphunit.cc:1240
0xaa6ced symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/cgraphunit.cc:2500

I tent to believe that this issue is distinct from the one reported in PR95338.

[1] https://github.com/nncarlson/fortran-compiler-tests

Reply via email to