https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29600
--- Comment #17 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- What I am trying to do is to have only one version of each library routine (the one using gfc_index_kind), and then convert to the KIND parameter that the user specified (or to default integer if the user didn't specify anything). This would also allow to reduce library bloat. This works fine with the attached patch. I did not yet touch the library, but removing the then-unneeded versions of the library functions would be fairly trivial. We're breaking binary compatibility anyway, so we might as well do that. The only problem is that it causes regressions in bounds checking - the __convert_i8_i4 function call (in case where gfc_index_type has 8 bytes and normal integers have 4 bytes). This is a more or less unrelated problem, and is PR82660. Now, we could argue that the bounds violations for minloc and maxloc are not very important, since the dimension of the return array is the rank of the argument - in the normal case, compile-time checking will catch the problem anyway. We would then accept a regression in return for implementing an (IMHO) important part of F2003 - without these KIND argumetns, MINLOC and MAXLOC are useless for long linear arrays with > 2^31 elements. Of course, we should also focus on PR 82660. What do you think?