https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108693
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |97977 CC| |burnus at gcc dot gnu.org --- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> --- Pre-remark: Allocatable scalar character variables consists of a pointer to the actual data ('mask') and a hidden variable ('.mask') which contains the string length. * * * lower_omp_taskreg calls lower_rec_input_clauses which has: 6199 x = build_outer_var_ref (var, ctx); (gdb) p debug(x) .omp_data_i->mask So far so good, but when calling 6329 x = lang_hooks.decls.omp_clause_copy_ctor 6330 (c, unshare_expr (new_var), x); But that causes too much code to be generated and that code also has an error_mark_node: (gdb) p debug(x) { void * D.4350; if ((void *) .omp_data_i->mask != 0B) { mask = (character(kind=1)[1:D.4340] *) .omp_data_i->mask; D.4350 = __builtin_malloc (MAX_EXPR <(unsigned long) SAVE_EXPR <(sizetype) NON_LVALUE_EXPR <<<< error >>>>>, 1>); * * * I think one issue is that there is no 'shared(.mask)' to make the string available. — We had a similar discussion elsewhere. -> PR97977. I vaguely recall some IRC discussion about this that the solution is non-trivial in general (for implicit mapping). However, here we have an explicit 'share(mask)', where adding an implicit 'share(.mask)' could be easier. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97977 [Bug 97977] Fortran deferred length strings incompatible with OMP