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

            Bug ID: 79229
           Summary: [7.0.1 regression] ICE in gfc_trans_assignment_1 with
                    -fcheck=mem
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

The following code leads to an ICE when compiled with -fcheck=mem
(without the flag, it compiles):
$ gfortran -fcheck=mem -c sf_isr_uti.f90
sf_isr_uti.f90:19:0:

     allocate (t3 :: sf_int (2))

internal compiler error: in gfc_trans_assignment_1, at
fortran/trans-expr.c:9964

sf_isr_uti.f90:19:0: internal compiler error: Abort trap: 6


Code that triggers the ICE:


module uti
  implicit none
  private
  type, abstract :: t1
  end type t1

  type :: t2
  end type t2

  type, extends (t1) :: t3
     private
     type(t2), pointer :: data => null ()
  end type t3

contains

  subroutine s_1 ()
    class(t1), dimension(:), allocatable :: sf_int
    allocate (t3 :: sf_int (2))
  end subroutine s_1

end module uti

Reply via email to