https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105691
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:614d9e76b71df6c5ad42f2b9c2a8156e8b3ebd35 commit r11-10102-g614d9e76b71df6c5ad42f2b9c2a8156e8b3ebd35 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.c (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. (cherry picked from commit ff35dbc02092fbcd3d814fcd9fe8e871c3f741fd)