@@ -1,5 +1,13 @@
2014-11-11 Thomas Schwinge <thomas@codesourcery.com>
+ * gfortran.h (OMP_LIST_COPY, OMP_LIST_DATA_CLAUSE_FIRST)
+ (OMP_LIST_DATA_CLAUSE_LAST, OMP_LIST_LAST): Remove.
+ * dump-parse-tree.c (show_omp_clauses): Update.
+ * openmp.c (resolve_omp_clauses, gfc_resolve_oacc_declare):
+ Likewise.
+ * trans-openmp.c (gfc_trans_omp_clauses): Likewise.
+ (gfc_trans_omp_map_clause_list): Remove.
+
* gfortran.h (OMP_LIST_DEVICEPTR): Remove, and instead...
(enum gfc_omp_map_op): ... add OMP_MAP_FORCE_DEVICEPTR here.
* dump-parse-tree.c (show_omp_clauses): Update.
@@ -1251,7 +1251,6 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
const char *type = NULL;
switch (list_type)
{
- case OMP_LIST_COPY: type = "COPY"; break;
case OMP_LIST_USE_DEVICE: type = "USE_DEVICE"; break;
case OMP_LIST_DEVICE_RESIDENT: type = "USE_DEVICE"; break;
case OMP_LIST_CACHE: type = ""; break;
@@ -1183,14 +1183,10 @@ enum
OMP_LIST_TO,
OMP_LIST_FROM,
OMP_LIST_REDUCTION,
- OMP_LIST_COPY,
- OMP_LIST_DATA_CLAUSE_FIRST = OMP_LIST_COPY,
- OMP_LIST_DATA_CLAUSE_LAST = OMP_LIST_DATA_CLAUSE_FIRST,
OMP_LIST_DEVICE_RESIDENT,
OMP_LIST_USE_DEVICE,
OMP_LIST_CACHE,
- OMP_LIST_NUM,
- OMP_LIST_LAST = OMP_LIST_NUM
+ OMP_LIST_NUM
};
/* Because a symbol can belong to multiple namelists, they must be
@@ -2870,11 +2870,8 @@ resolve_omp_clauses (gfc_code *code, locus *where,
static const char *clause_names[]
= { "PRIVATE", "FIRSTPRIVATE", "LASTPRIVATE", "COPYPRIVATE", "SHARED",
"COPYIN", "UNIFORM", "ALIGNED", "LINEAR", "DEPEND", "MAP",
- "TO", "FROM", "REDUCTION",
- "COPY", "COPYIN", "COPYOUT", "CREATE", "DELETE", "PRESENT",
- "PRESENT_OR_COPY", "PRESENT_OR_COPYIN", "PRESENT_OR_COPYOUT",
- "PRESENT_OR_CREATE", "DEVICE_RESIDENT", "USE_DEVICE",
- "HOST", "DEVICE", "CACHE" };
+ "TO", "FROM", "REDUCTION", "DEVICE_RESIDENT", "USE_DEVICE",
+ "CACHE" };
if (omp_clauses == NULL)
return;
@@ -3231,15 +3228,6 @@ resolve_omp_clauses (gfc_code *code, locus *where,
break;
}
- if (list >= OMP_LIST_DATA_CLAUSE_FIRST
- && list < OMP_LIST_DATA_CLAUSE_LAST)
- resolve_oacc_data_clauses (n->sym, *where, name);
-
- if (list > OMP_LIST_DATA_CLAUSE_LAST)
- {
- check_symbol_not_pointer (n->sym, *where, name);
- check_array_not_assumed (n->sym, *where, name);
- }
switch (list)
{
case OMP_LIST_REDUCTION:
@@ -3391,6 +3379,11 @@ resolve_omp_clauses (gfc_code *code, locus *where,
if (n->sym->attr.cray_pointee)
gfc_error ("Cray pointee object '%s' in %s clause at %L",
n->sym->name, name, where);
+ /* FALLTHRU */
+ case OMP_LIST_DEVICE_RESIDENT:
+ case OMP_LIST_CACHE:
+ check_symbol_not_pointer (n->sym, *where, name);
+ check_array_not_assumed (n->sym, *where, name);
break;
default:
break;
@@ -4618,10 +4611,6 @@ gfc_resolve_oacc_declare (gfc_namespace *ns)
int list;
gfc_omp_namelist *n;
locus loc;
- static const char *clause_names[] = {"COPY", "COPYIN", "COPYOUT", "CREATE",
- "DELETE", "PRESENT", "PRESENT_OR_COPY", "PRESENT_OR_COPYIN",
- "PRESENT_OR_COPYOUT", "PRESENT_OR_CREATE",
- "DEVICE_RESIDENT"};
if (ns->oacc_declare_clauses == NULL)
return;
@@ -4629,7 +4618,7 @@ gfc_resolve_oacc_declare (gfc_namespace *ns)
loc = ns->oacc_declare_clauses->ext.loc;
/* FIXME: handle omp_list_map. */
- for (list = OMP_LIST_DATA_CLAUSE_FIRST;
+ for (/* TODO */ list = OMP_LIST_DEVICE_RESIDENT;
list <= OMP_LIST_DEVICE_RESIDENT; list++)
for (n = ns->oacc_declare_clauses->lists[list]; n; n = n->next)
{
@@ -4638,7 +4627,7 @@ gfc_resolve_oacc_declare (gfc_namespace *ns)
gfc_error ("PARAMETER object '%s' is not allowed at %L", n->sym->name, &loc);
}
- for (list = OMP_LIST_DATA_CLAUSE_FIRST;
+ for (/* TODO */ list = OMP_LIST_DEVICE_RESIDENT;
list <= OMP_LIST_DEVICE_RESIDENT; list++)
for (n = ns->oacc_declare_clauses->lists[list]; n; n = n->next)
{
@@ -4649,20 +4638,9 @@ gfc_resolve_oacc_declare (gfc_namespace *ns)
n->sym->mark = 1;
}
- for (list = OMP_LIST_DATA_CLAUSE_FIRST;
- list < OMP_LIST_DATA_CLAUSE_LAST; /* Skip deviceptr clause. */
- list++)
- {
- const char *name = clause_names[list - OMP_LIST_DATA_CLAUSE_FIRST];
- for (n = ns->oacc_declare_clauses->lists[list]; n; n = n->next)
- resolve_oacc_data_clauses (n->sym, loc, name);
- }
-
for (n = ns->oacc_declare_clauses->lists[OMP_LIST_DEVICE_RESIDENT]; n;
n = n->next)
- check_array_not_assumed (n->sym, loc,
- clause_names[OMP_LIST_DEVICE_RESIDENT -
- OMP_LIST_DATA_CLAUSE_FIRST]);
+ check_array_not_assumed (n->sym, loc, "DEVICE_RESIDENT");
}
@@ -1707,25 +1707,6 @@ gfc_trans_omp_reduction_list (gfc_omp_namelist *namelist, tree list,
return list;
}
-static tree
-gfc_trans_omp_map_clause_list (enum omp_clause_map_kind kind,
- gfc_omp_namelist *namelist, tree list)
-{
- for (; namelist != NULL; namelist = namelist->next)
- if (namelist->sym->attr.referenced)
- {
- tree t = gfc_trans_omp_variable (namelist->sym, false);
- if (t != error_mark_node)
- {
- tree node = build_omp_clause (input_location, OMP_CLAUSE_MAP);
- OMP_CLAUSE_DECL (node) = t;
- OMP_CLAUSE_MAP_KIND (node) = kind;
- list = gfc_trans_add_clause (node, list);
- }
- }
- return list;
-}
-
static inline tree
gfc_convert_expr_to_tree (stmtblock_t *block, gfc_expr *expr)
{
@@ -1759,18 +1740,6 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
if (n == NULL)
continue;
- if (list >= OMP_LIST_DATA_CLAUSE_FIRST
- && list <= OMP_LIST_DATA_CLAUSE_LAST)
- {
- enum omp_clause_map_kind kind;
- switch (list)
- {
- default:
- gcc_unreachable ();
- }
- omp_clauses = gfc_trans_omp_map_clause_list (kind, n, omp_clauses);
- continue;
- }
switch (list)
{
case OMP_LIST_REDUCTION: