https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93340
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:2259e712a6348bd23586dde06cc874a35fdc53c3 commit r9-9252-g2259e712a6348bd23586dde06cc874a35fdc53c3 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)