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

            Bug ID: 96131
           Summary: ICE in fold_convert_loc, at fold-const.c:2435
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mscfd at gmx dot net
  Target Milestone: ---

The code below fails with an ICE in fold_convert_loc, at fold-const.c:2435.
There is another recent bug 94730 with an ICE at this location, but triggered
with C code. Is this maybe related?

Also fails with ICE with gfortran 8.2.1 and 9.1.1.

> gfortran-10 procptr.f90

module mod

implicit none
public

type :: t
   procedure(get_ifc), pointer, nopass :: get => null()
end type t

abstract interface
   function get_ifc() result(x)
      import t
      type(t), pointer :: x
   end function get_ifc
end interface

contains

   function foo() result(x)
      type(t), pointer :: x
      x => null()
   end function foo

end module mod


program procptr

use mod
implicit none

type(t) :: x
type(t), pointer :: y

x%get => foo
y => x%get()

end program procptr

Reply via email to