Hello world, F2003, 6.1.1. "Substrings" states that Both the starting point and the ending point shall be within the range 1, 2, ..., n unless the starting point exceeds the ending point, in which case the substring has length zero. The attached patch, which corrects the test case, has been committed as obvious. What's left is the accepts-invalid bug. Regards Thomas 2018-03-30 Thomas Koenig PR fortran/85130 * gfortran.dg/substr_6.f90: Remove illegal test for out-of-bounds substring.