diff options
Diffstat (limited to 'gcc/omp-general.c')
-rw-r--r-- | gcc/omp-general.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/omp-general.c b/gcc/omp-general.c index fa6de01..cc6aecb 100644 --- a/gcc/omp-general.c +++ b/gcc/omp-general.c @@ -79,10 +79,11 @@ omp_check_optional_argument (tree decl, bool for_present_check) return lang_hooks.decls.omp_check_optional_argument (decl, for_present_check); } -/* Return true if DECL is a reference type. */ +/* True if OpenMP should privatize what this DECL points to rather + than the DECL itself. */ bool -omp_is_reference (tree decl) +omp_privatize_by_reference (tree decl) { return lang_hooks.decls.omp_privatize_by_reference (decl); } @@ -968,7 +969,7 @@ omp_max_simt_vf (void) if (ENABLE_OFFLOADING) for (const char *c = getenv ("OFFLOAD_TARGET_NAMES"); c;) { - if (!strncmp (c, "nvptx", strlen ("nvptx"))) + if (startswith (c, "nvptx")) return 32; else if ((c = strchr (c, ':'))) c++; @@ -2576,6 +2577,7 @@ oacc_verify_routine_clauses (tree fndecl, tree *clauses, location_t loc, const char *routine_str) { tree c_level = NULL_TREE; + tree c_nohost = NULL_TREE; tree c_p = NULL_TREE; for (tree c = *clauses; c; c_p = c, c = OMP_CLAUSE_CHAIN (c)) switch (OMP_CLAUSE_CODE (c)) @@ -2608,6 +2610,10 @@ oacc_verify_routine_clauses (tree fndecl, tree *clauses, location_t loc, c = c_p; } break; + case OMP_CLAUSE_NOHOST: + /* Don't worry about duplicate clauses here. */ + c_nohost = c; + break; default: gcc_unreachable (); } @@ -2642,6 +2648,7 @@ oacc_verify_routine_clauses (tree fndecl, tree *clauses, location_t loc, this one for compatibility. */ /* Collect previous directive's clauses. */ tree c_level_p = NULL_TREE; + tree c_nohost_p = NULL_TREE; for (tree c = TREE_VALUE (attr); c; c = OMP_CLAUSE_CHAIN (c)) switch (OMP_CLAUSE_CODE (c)) { @@ -2652,6 +2659,10 @@ oacc_verify_routine_clauses (tree fndecl, tree *clauses, location_t loc, gcc_checking_assert (c_level_p == NULL_TREE); c_level_p = c; break; + case OMP_CLAUSE_NOHOST: + gcc_checking_assert (c_nohost_p == NULL_TREE); + c_nohost_p = c; + break; default: gcc_unreachable (); } @@ -2667,6 +2678,13 @@ oacc_verify_routine_clauses (tree fndecl, tree *clauses, location_t loc, c_diag_p = c_level_p; goto incompatible; } + /* Matching 'nohost' clauses? */ + if ((c_nohost == NULL_TREE) != (c_nohost_p == NULL_TREE)) + { + c_diag = c_nohost; + c_diag_p = c_nohost_p; + goto incompatible; + } /* Compatible. */ return 1; |