https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67987
--- Comment #2 from kargl at gcc dot gnu.org --- (In reply to kargl from comment #1) > I have a patch that I'm testing. For the code in the > intial report I get > > troutmask:sgk[238] gfc6 -c g6.f90 > g6.f90:2:15: > > character(-8) :: c = ' ' > 1 > Error: LEN at (1) must be greater than or equal to 0 Seems the patch causes a regression for char_length_2.f90. This test came in with the fix for PR fortran/31250, where negative length parameters are silently set to 0. The fix for this regression is in resolve.c. Unfortnately, this fix then exposes an issue with substring referecences. For "string"(1:-1), this should result in a 0 length string, but gfortran is setting the length to -1 in gfc_resolve_substring_charlen.