Open certik opened 1 year ago
Here is an even simpler example:
module b
integer :: real_kinds(2)
end module
program a
use b, only: real_kinds
print *, real_kinds(1)
end program a
but it gives a different error message:
$ lfortran b.f90
Assertion failed: (Ty && "Invalid GetElementPtrInst indices for type!"), function checkGEPType, file Instructions.h, line 897.
Traceback (most recent call last):
File "/Users/ondrej/mambaforge/envs/lf/include/llvm/IR/Instructions.h", line 1074
Type *PtrTy = PointerType::get(checkGEPType(getIndexedType(ElTy, IdxList)),
File "/Users/ondrej/mambaforge/envs/lf/include/llvm/IR/Instructions.h", line 897
assert(Ty && "Invalid GetElementPtrInst indices for type!");
Binary file "/usr/lib/system/libsystem_c.dylib", local address: 0x18024972b
Binary file "/usr/lib/system/libsystem_c.dylib", local address: 0x18024a313
Binary file "/usr/lib/system/libsystem_pthread.dylib", local address: 0x18030ceaf
Binary file "/usr/lib/system/libsystem_platform.dylib", local address: 0x1803244e3
Abort: Signal SIGABRT (abort) received
zsh: abort lfortran b.f90
But it's a bit related, so we need to fix both.
Here is a minimal example:
This gives:
The issue is this part of the code:
The array does not seem to be generated in LLVM first.