https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102314

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, if we make those arrays incomplete, gfc_omp_finish_clause will need to
figure out what size to use.  This is in:
  if (OMP_CLAUSE_SIZE (c) == NULL_TREE)
    OMP_CLAUSE_SIZE (c)
      = DECL_P (decl) ? DECL_SIZE_UNIT (decl)
                      : TYPE_SIZE_UNIT (TREE_TYPE (decl));
  if (gimplify_expr (&OMP_CLAUSE_SIZE (c), pre_p,
                     NULL, is_gimple_val, fb_rvalue) == GS_ERROR)
    OMP_CLAUSE_SIZE (c) = size_int (0);
and the gimplify_expr part is what my change added.  We'll need to check some
Fortran specific type flags etc. to see it is a deferred-length character and
find the corresponding . variable, though TYPE_LANG_SPECIFIC is NULL on the
ARRAY_TYPE created by gfc_get_character_type_len_for_eltype -> build_array_type
it seems.

Reply via email to