https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86372
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code --- Comment #1 from janus at gcc dot gnu.org --- Test case: program xxx character(len=50) :: s s = repeat('*', len(s)) call sub(s) print *, s contains subroutine sub(str) character(len=*), intent(inout) :: str associate (substr => str(3:5)) substr = '123' end associate end subroutine end With gfortran version 5 to 7 it compiles ok and prints at runtime: ************************************************** This is already wrong, since the string should be modified is the subroutine. With gfortran 8 and trunk there is even a segfault at runtime (on the line "substr = '123'"), and the warning mentioned in PR 56670 comment 5: substr = '123' Warning: ‘.substr’ is used uninitialized in this function [-Wuninitialized]