diff options
Diffstat (limited to 'gcc/c-family/c-omp.cc')
-rw-r--r-- | gcc/c-family/c-omp.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc index 66d17a2..56bc4b1 100644 --- a/gcc/c-family/c-omp.cc +++ b/gcc/c-family/c-omp.cc @@ -714,8 +714,17 @@ c_finish_omp_depobj (location_t loc, tree depobj, if (clause) { - gcc_assert (TREE_CODE (clause) == OMP_CLAUSE - && OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_DEPEND); + gcc_assert (TREE_CODE (clause) == OMP_CLAUSE); + if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_DOACROSS) + { + error_at (OMP_CLAUSE_LOCATION (clause), + "%<depend(%s)%> is only allowed in %<omp ordered%>", + OMP_CLAUSE_DOACROSS_KIND (clause) + == OMP_CLAUSE_DOACROSS_SOURCE + ? "source" : "sink"); + return; + } + gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_DEPEND); if (OMP_CLAUSE_CHAIN (clause)) error_at (OMP_CLAUSE_LOCATION (clause), "more than one locator in %<depend%> clause on %<depobj%> " @@ -727,13 +736,6 @@ c_finish_omp_depobj (location_t loc, tree depobj, "%<depobj%> dependence type specified in %<depend%> " "clause on %<depobj%> construct"); return; - case OMP_CLAUSE_DEPEND_SOURCE: - case OMP_CLAUSE_DEPEND_SINK: - error_at (OMP_CLAUSE_LOCATION (clause), - "%<depend(%s)%> is only allowed in %<omp ordered%>", - OMP_CLAUSE_DEPEND_KIND (clause) == OMP_CLAUSE_DEPEND_SOURCE - ? "source" : "sink"); - return; case OMP_CLAUSE_DEPEND_IN: case OMP_CLAUSE_DEPEND_OUT: case OMP_CLAUSE_DEPEND_INOUT: @@ -765,7 +767,7 @@ c_finish_omp_depobj (location_t loc, tree depobj, } } else - gcc_assert (kind != OMP_CLAUSE_DEPEND_SOURCE); + gcc_assert (kind != OMP_CLAUSE_DEPEND_INVALID); if (depobj == error_mark_node) return; |