https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102315
--- Comment #2 from anlauf at gcc dot gnu.org --- Looks familiar, and I am pretty sure there's a duplicate. Removing one set of [] makes the code compile: y = [character(8) :: 'a'//trim(x), 'b', 'c', 'd', 'e'] is obviously "fine".