https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70994
Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2016-05-07 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Confirmed from 4.5 up to trunk (7.0). Note that the code compiled with 4.4.7 and '-Wall -fbounds-check' executes without error. Work-around subroutine f(name) implicit none character(len=*), intent(in) :: name character, dimension(512) :: cname integer :: i, l l = len_trim(name) i = l cname(1:len_trim(name)+1) = (/ ( name(i:i), i = 1,len_trim(name) ), char(0) /) end subroutine f program t implicit none character(len=22) :: name name = 'abcdefghijklmnopqr ' call f(name) end program t