Bind(C) prif_coarray_handle#3
Conversation
9920535 to
6fddf2d
Compare
d0d9cdd to
219b15c
Compare
|
@certik This branch contains some new development in Caffeine for a forthcoming feature. The latest commit (028cfd7) currently appears to be ICE'ing LFortran 0.62 and How can we narrow this down further? |
|
@bonachea Let me have a look to isolate an MRE, then we can fix it. I think this is unrelated to lfortran/lfortran#11175 ? I can reproduce the failure. I am creating an MRE. Here is the MRE: program mre
implicit none
type :: t
integer :: x
end type
type(t), pointer :: src, dest
allocate(src)
src%x = 1
allocate(dest, source=src)
if (dest%x /= 1) error stop "FAIL"
print *, "PASS"
deallocate(src)
deallocate(dest)
end programWhich gives: ~/repos/caffeine(build4-mre)$ lfortran mre_allocate_source_ptr.f90
LCOMPILERS_ASSERT failed: /Users/ondrej/repos/lfortran/src/libasr/codegen/llvm_utils.cpp
function create_gep2(), line number 1774 at
ds_pointee_type == t
ERROR MESSAGE:
Type mismatch in create_gep2: GEP target type does not match pointer's pointee type. This would cause crashes in LLVM <= 8 constant folder. Target type: %mre.t = type { i32 }, Pointer pointee type: %mre.t*
Traceback (most recent call last):
...I am fixing it. |
|
There were a few more bugs, so I fixed them all. With this PR lfortran/lfortran#11179 the I also tested the old main (b8dd1f9) and that also works with the PR: I also tested the latest main with your main, and that also failed, so I think we didn't have enough integration tests to keep it running. I'll see if I can set it up at our CI to test Caffeine with every commit. |
|
@bonachea ok, so lfortran/lfortran#11181 is in, the latest main in LFortran now works. I have some more fixes / cleanup on top, but that shouldn't be a blocker for you. You can also remove 028cfd7 which now works. |
Thanks for the amazingly quick turnaround on these fixes @certik !! I've re-run the CI for this PR against This PR will ideally merge to |
|
I can release it any time you want. I am trying to get caffeine tested at our CI: lfortran/lfortran#11190, to ensure it is reproducible (but since it already works for you, I think we have it) and to prevent future breakages. Then we can make a release. |
04c6a3d to
338b73c
Compare
* Replace info field with type(c_ptr) * Add helper functions to convert between prif_coarray_handle and descriptor pointer (dp) * Adjust all internal manipulation of prif_coarray_handle * Make some minor unrelated improvements to affected code while rewriting
* Convert prif_coarray_handle argument from pointer to value * Convert errmsg argument to kind=c_char * Update tests
As the redesigned final_func is now supported by all supported compilers
Convert `prif_allocate_coarray(final_func)` argument to: `procedure(prif_coarray_cleanup_interface), pointer` Adjust test code accordingly
Also, add gfortran bug workarounds: 1. Use caf_c_funloc_deref helper to workaround broken c_funloc 2. Use final_func_usher for !HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY
… from C finalizer
Adjust tests accordingly
As resolved in the 2026-04-16 PRIF Committee meeting Adjust tests, removing keyword args to work with either version of PRIF
|
Superseded by BerkeleyLab#320 |
Implements https://github.com/BerkeleyLab/prif/issues/157 , proposals 2, 2.1. 2.2, 2.3