https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84615
--- Comment #12 from Janne Blomqvist <jb at gcc dot gnu.org> --- So to be clear, the problem seems to be that while the code generation for the function itself appears Ok, it generates the interface wrong (i.e. uses the declared charlen kind instead of C_SIZE_T), and thus calling it doesn't work properly. I still have no idea where in the frontend code the error is.