https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92844
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> --- I think that is or could be a duplicate of PR 92305. See esp. PR 92305 comment 8 (and following) and PR 92305 comment 16. At least both use type(c_ptr) and optional. I think it makes sense to fix PR 92305 first before digging into this issue, in case it is the same issue. Any debugging help with PR 92305 is highly welcome.