https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95499
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- For 'character(len=:),allocatable :: str' there is '_str' with the string length. One can map it explicitly when mapping 'from(str)' by also mapping 'firstprivate(_str)' but the compiler will later remove it as '_str' is (initially) unused. Later, gfc_omp_clause_default_ctor is called for 'private(str) – the generated tree uses "malloc(max(1, _str))", but at that point is too late for the mapping analysis – hence, '_str' is not mapped. Note: gfc_omp_finish_clause is not called for 'str' and '_str' is not yet used at this point. This has to be supported for a scalar 'str', an array str, and either as derived-type component. (For the latter, see also PR95837 for kind=4 issues.)