https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58618
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2013-10-05 00:00:00 |2017-8-3 CC| |tkoenig at gcc dot gnu.org --- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- The tree dump of a slightly modified test case (just to make things look more tidy) seems OK at first glance, but there is one strange thing: program main character(1) :: s(1) s = "a" call printit(s(1)(1:1) ) associate (x=>s(1)(1:1)) call printit(x) end associate contains subroutine printit(y) character(len=*) :: y print *,y end subroutine printit end program main This gives: MAIN__ () { static void printit (character(kind=1)[1:] & restrict, integer(kind=4)); character(kind=1) s[1][1:1]; { character(kind=1)[1:1] * x; ^^^^^ { integer(kind=8) S.1; S.1 = 1; while (1) { if (S.1 > 1) goto L.1; s[S.1 + -1][1]{lb: 1 sz: 1} = 97; S.1 = S.1 + 1; } L.1:; } printit (&s[0], 1); x = (character(kind=1)[1:1] *) &&s[0]; ^^^^^^^^ printit (x, 1); L.2:; } } Seems like the type of x is wrong here.