Issue 240635
Summary flang-23 crashes on type-bound procedure of type that extends another type
Labels new issue
Assignees
Reporter dblaschke-LANL
    here is a MWE:
***
module test_flang
  type sometype
    real(8) :: x
  end type sometype
  
  type, extends(sometype) :: othertype
    real(8) :: y, z
    contains
 procedure :: somecalc => somecalc
  end type othertype
  
  contains
 subroutine somecalc(z)
      class(othertype), intent(inout) :: z
      z%z = z%x + z%y
    end subroutine somecalc
end module test_flang

program test1
  use test_flang
  type(othertype) :: a
  a%x = 1.d0
  a%y = 2.d0
 call a%somecalc()
  print*,a%z
end program test1

**********

flang 23.1.4 (from conda-forge) crashes with
"error: runtime derived type info descriptor was not generated and skipExternalRttiDefinition and ignoreMissingTypeDescriptors options are not set
LLVM ERROR: aborting"

flang 22 works just fine with the above code

I first noticed this bug when compiling https://github.com/dblaschke-LANL/PyDislocDyn where flang-23 complained:
"error: Lowering to LLVM IR failed
loc("/***/PyDislocDyn/pydislocdyn/dislocations.f90":372:20): error: LLVM Translation failed for operation: fir.local
error: failed to create the LLVM module
just bringing it up since the error message is different from the MWE above, but it also happens where a type-bound procedure is defined for a type that extends another type.

All code mentioned here works fine with flang-22 as well as gfortran 10-16, lfortran 0.68, and ifx >=2024

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to