Hi Andre,
first, thanks a lot for all your proof reading of patches! That's indeed
helpful and reviewing (with offical LGTM stamp or as bystander) is a
problem, you help to reduce it! :-)
Andre Vehreschild wrote:
@@ -821,6 +821,23 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
+ if (sym->attr.omp_allocate && TREE_STATIC (decl))
+ {
+ struct gfc_omp_namelist *n;
+ for (n = sym->ns->omp_allocate; n; n = n->next)
+ if (n->sym == sym)
+ break;
Theoretically n can be NULL here. This would then ICE. Or is there a guarantee,
that n is never NULL
+ tree alloc = gfc_conv_constant_to_tree (n->u2.allocator);
One should never say never, but I think it should never be NULL. In openmp.cc:
gfc_resolve_omp_allocate (gfc_namespace *ns, gfc_omp_namelist *list)
{
for (gfc_omp_namelist *n = list; n; n = n->next)
...
n->sym->attr.omp_allocate = 1;
And the caller is in resolve.cc:
if(ns->omp_allocate)
gfc_resolve_omp_allocate (ns, ns->omp_allocate);
Cheers,
Tobias
PS: If you wonder about modules: It is not saved in .mod files. As it
about allocating a variable, this property is only required where the
variable is actually defined/has storage not where it is only accessed.
Otherwise, that would be a loop hole.