https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93340
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:c5ba7770768ed0a7b5d61a3a2fa1625d98be351f commit r10-9391-gc5ba7770768ed0a7b5d61a3a2fa1625d98be351f Author: Harald Anlauf <anl...@gmx.de> Date: Thu Jan 14 20:25:33 2021 +0100 PR fortran/93340 - fix missed substring simplifications Substrings were not reduced early enough for use in initializations, such as DATA statements. Add an early simplification for substrings with constant starting and ending points. gcc/fortran/ChangeLog: * gfortran.h (gfc_resolve_substring): Add prototype. * primary.c (match_string_constant): Simplify substrings with constant starting and ending points. * resolve.c: Rename resolve_substring to gfc_resolve_substring. (gfc_resolve_ref): Use renamed function gfc_resolve_substring. gcc/testsuite/ChangeLog: * substr_10.f90: New test. * substr_9.f90: New test. (cherry picked from commit bdd1b1f55529da00b867ef05a53a08fbfc3d1c2e)