https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105691
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:ff35dbc02092fbcd3d814fcd9fe8e871c3f741fd commit r13-1277-gff35dbc02092fbcd3d814fcd9fe8e871c3f741fd Author: Harald Anlauf <anl...@gmx.de> Date: Tue Jun 21 23:20:18 2022 +0200 Fortran: fix simplification of INDEX(str1,str2) [PR105691] gcc/fortran/ChangeLog: PR fortran/105691 * simplify.cc (gfc_simplify_index): Replace old simplification code by the equivalent of the runtime library implementation. Use HOST_WIDE_INT instead of int for string index, length variables. gcc/testsuite/ChangeLog: PR fortran/105691 * gfortran.dg/index_6.f90: New test.