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

            Bug ID: 80766
           Summary: [7 Regression] ICE with type bound procedures
                    returning an array
           Product: gcc
           Version: 7.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com
  Target Milestone: ---

The following:

module m1

  type :: base
  contains
     procedure :: fun
  end type

  type, extends(base) :: child
  end type

contains

  function fun(o) result(res)
    real :: res(3)
    class(base) :: o

    res = 0
  end function
end module


module m2
contains

  subroutine sub(o)
    use m1
    class(child) :: o
    real :: res(3)

    res = o%fun()
  end subroutine
end module


causes:

> gfortran-7 -cpp ice12.f90  -c
ice12.f90:30:0:

     res = o%fun()

internal compiler error: in fold_convert_loc, at fold-const.c:2303
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.


in gfortran 7.1.1 (from the OpenSUSE GCC devel repository)

It does not ICE if the subroutine is external or in module m1. It does not ICE
if the base is used instead of child. It does not ICE if the function returns a
scalar.

Reply via email to