https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84615
--- Comment #14 from Janne Blomqvist <jb at gcc dot gnu.org> --- (In reply to Thomas Koenig from comment #13) > (In reply to Janne Blomqvist from comment #12) > > 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'm confused. Should not the charlen kind be identical to C_SIZE_T, also > for -m32? Yes, it should. But if you look e.g. at #c8 and #c9 you'll see that in the interface the compiler thinks it should be kind=8 (on 32-bit i686), most likely because the charlen is declared as kind=8. Which isn't C_SIZE_T which is 4 on 32-bit targets. So what I'm trying to say is that we should always treat charlens as kind=C_SIZE_T (gfc_charlen_type_node) in interfaces regardless of how they are actually declared in the Fortran source code.