On Tue, Sep 15, 2020 at 12:48:59AM +0200, Tobias Burnus wrote:
> + bool has_nullptr;
> + size_t j;
> + for (j = 0; j < n->tgt->list_count; j++)
> + if (n->tgt->list[j].key == n)
> + {
> + has_nullptr = n->tgt->list[j].has_null_ptr_assoc;
> + break;
> + }
> + if (n->tgt->list_count == 0)
> + {
> + /* 'declare target'; assume has_nullptr; it could also be
> + statically assigned pointer, but that it should be to
> + the equivalent variable on the host. */
> + assert (n->refcount == REFCOUNT_INFINITY);
> + has_nullptr = true;
> + }
> + else
> + assert (j < n->tgt->list_count);
> + /* Re-map the data if there is an 'always' modifier or if it a
> + null pointer was there and non a nonnull has been found; that
> + permits transparent re-mapping for Fortran array descriptors
> + which were previously mapped unallocated. */
> + for (j = i + 1; j < mapnum; j++)
> + {
> + int ptr_kind = get_kind (short_mapkind, kinds, j) & typemask;
> + if (!GOMP_MAP_ALWAYS_POINTER_P (ptr_kind)
> + && (!has_nullptr
David Edelsohn just reported this (rightly so) results in -Wuninitialized
warnings, I think you meant bool has_nullptr = false;
in the definition (in both places that it is defined at).
Jakub